F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
大视野在线测评-欢迎您
[ New Thread ]
Problem 1856 >> 神秘CE= =
kai586123 @ 2019-02-15 20:26:03
[ Quote ] [ Edit ] [ Delete ] 1#
rt 惊了

g++: Internal error: File size limit exceeded (program as)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.

/**************************************************************
Problem: 1856
User: kai586123
Language: C++
Result: Compile_Error
****************************************************************/

#include <bits/stdc++.h>
using namespace std;
const int MOD = 20100403;
long long n, m, fac[MOD] = {1, 1}, inv[MOD];
long long C(int n, int m) { return fac[n] * inv[m] % MOD * inv[n - m] % MOD; }
int main() {
cin >> n >> m;
for (int i = 2; i <= n + m; ++i)
fac[i] = fac[i - 1] * i % MOD;
inv[n + m] = 1;
for (long long x = fac[n + m], y = MOD - 2; y; y >>= 1, x = x * x % MOD)
if (y & 1)
inv[n + m] = inv[n + m] * x % MOD;
for (int i = n + m - 1; i >= 0; --i)
inv[i] = (i + 1) * inv[i + 1] % MOD;
cout << ((C(n + m, m) - C(n + m, m - 1) + MOD) % MOD) << endl;
return 0;
}
[Top] [Previous Page] [Next Page]

HOME Back