# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19918 |
2016-02-25T07:12:24 Z |
xdoju |
괄호 (kriii4_R) |
C++14 |
|
92 ms |
1084 KB |
#include <cstdio>
using namespace std;
const int MOD = 1000000007ll;
int modpow(int r, int n) {
int ret = 1;
while (n > 0) {
if (n % 2 > 0) {
ret = ((long long)ret * r) % MOD;
}
r = ((long long)r * r) % MOD;
n /= 2;
}
return ret;
}
inline int modinv(int n) {
return modpow(n, MOD - 2);
}
inline int modprod(int a, int b) {
a = a % MOD;
b = b % MOD;
return ((long long)a * b) % MOD;
}
inline int modprod(int a, int b, int c) {
c = c % MOD;
return (modprod(a, b) * (long long)c) % MOD;
}
inline int moddiv(int a, int b) {
return ((long long)a * modinv(b)) % MOD;
}
int cc(int n) {
int ret = 1;
for (int k = 2 * n; k > n; --k) {
ret = modprod(ret, k);
}
for (int k = 1; k <= n; ++k) {
ret = moddiv(ret, k);
}
return ret;
}
void proc() {
int n, k;
scanf("%d %d", &n, &k);
if (n % 2 == 0) {
printf("%d", cc(n / 2));
}
else {
printf("%d", cc((n + 1) / 2) / 2);
}
}
int main() {
proc();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
1084 KB |
Output is correct |
2 |
Correct |
8 ms |
1084 KB |
Output is correct |
3 |
Incorrect |
92 ms |
1084 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |