# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19726 |
2016-02-25T04:59:56 Z |
algoshipda |
괄호 (kriii4_R) |
C++14 |
|
69 ms |
5628 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
const int MOD = 1e9 + 7;
const int MN = 1e6 + 10;
int fpow(int n, int k)
{
if(k == 0) return 1;
if(k % 2){
return 1ll * n * fpow(n, k - 1) % MOD;
}
int h = fpow(n, k / 2);
return 1ll * h * h % MOD;
}
inline int inv(int n)
{
return 1ll * fpow(n, MOD - 2) % MOD;
}
inline void mult(int& a, int b)
{
a = 1ll * a * b % MOD;
}
inline int mult2(int a, int b)
{
return 1ll * a * b % MOD;
}
inline void sub(int& a, int b)
{
a = ((a - b) % MOD + MOD) % MOD;
}
inline int rational(int a, int b)
{
return 1ll * a * inv(b) % MOD;
}
inline void add(int &a, int b)
{
a = ((a + b) % MOD + MOD) % MOD;
}
int pmul[MN];
int main()
{
int n, k;
cin >> n >> k;
pmul[0] = 1;
for(int i = 1; i <= n; ++i){
pmul[i] = mult2(i, pmul[i - 1]);
}
int ans = 0;
for(int i = n / 2 + 1; i <= n; ++i){
add(ans, mult2(pmul[i], inv(pmul[2 * i - n])));
}
cout << ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
5628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |