# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
20033 |
2016-02-25T08:45:47 Z |
suzy |
괄호 (kriii4_R) |
C++ |
|
392 ms |
16708 KB |
#include <stdio.h>
#define MOD 1000000007
typedef long long lli;
lli f[1000001];
lli inv[1000001];
lli p(lli a, lli x) {
if(x==0) return 1;
if(x%2) return a*p(a,x-1)%MOD;
else { lli m=p(a,x/2); return m*m%MOD; }
}
lli C(lli k) {
lli ret=f[2*k]*inv[k]%MOD;
return ret*inv[k+1]%MOD;
}
int main() {
int n, k;
f[0]=f[1]=1;
for(lli i=2;i<=1000000;i++)
f[i]=f[i-1]*i%MOD;
for(lli i=0;i<=1000000;i++)
inv[i]=p(f[i],MOD-2);
scanf("%d %d",&n,&k);
lli res=0, t=1;
for(lli l=1;l<=n;l++) {
if(l%2) t=(t*2-C((l-1)/2))%MOD;
else t=t*2%MOD;
}
printf("%lld",t);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
392 ms |
16708 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |