有没有高精乘高精的模板题?

P1050 [NOIP2005 普及组] 循环

@[NaCly_Fish](/space/show?uid=115864) 为什么画风更加毒瘤了.. 楼主只想要高精来着qwq
by wjyyy @ 2019-03-27 22:51:27


@[wjyyy](/space/show?uid=63539) 这题不毒瘤吧qwqwq
by NaCly_Fish @ 2019-03-27 22:54:41


@[NaCly_Fish](/space/show?uid=115864) 对于dalao来说所有题都很水
by sunxiaofan @ 2019-03-27 22:57:06


好厉害,楼上的巨佬都是~~外国人吧~~
by PrincessQi @ 2019-03-27 22:57:43


~~楼主问的应该是普通高精吧,各位神仙推荐FFT题干嘛...~~
by StudyingFather @ 2019-03-27 23:15:07


@[NaCly_Fish](/space/show?uid=115864) STO鱼姐姐
by 一扶苏一 @ 2019-03-28 07:34:46


@[一扶苏一](/space/show?uid=65363) zay怎么又来吊打我了啊QAQ
by NaCly_Fish @ 2019-03-28 07:36:26


$@sunxiaofan$ 您看看P1919的数据范围……$a,b≤10^{1000000}$ 您确定这是$O(N^2)$高精……
by 54Teddy @ 2020-03-22 11:31:15


@[sunxiaofan](/user/121646) P2841 A*B Problem
by hanyuzhe @ 2021-10-30 09:08:10


```cpp #include <iostream> #include <cstring> using namespace std; int main() { char a_str[1000] = {}, b_str[1000] = {}; int a_int[1001] = {}, b_int[1001] = {}; int ans[1001] = {}; int len_a, len_b, len_ans = 0; int in = 0; cin >> a_str >> b_str; len_a = strlen(a_str); len_b = strlen(b_str); for (int i = 0; i < len_a; i++) { a_int[len_a - 1 - i] = a_str[i] - '0'; } for (int i = 0; i < len_b; i++) { b_int[len_b - i - 1] = b_str[i] - '0'; } for (int j = 0; j < len_b; j++) { for (int i = 0; i < len_a; i++) { ans[i + j] = (a_int[i] * b_int[j]) + in + ans[i + j]; in = ans[i + j] / 10; ans[i + j] %= 10; } ans[len_a + j] += in; in = 0; } len_ans = len_a + len_b; while (ans[len_ans - 1] == 0 && len_ans > 1) { len_ans--; } for (int i = len_ans - 1; i >= 0; i--) { cout << ans[i]; } return 0; } ```
by xzwdqjdx @ 2023-10-04 12:56:30


上一页 |