# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
20022 | | jihoon | 괄호 (kriii4_R) | C++98 | | 15 ms | 8896 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#define je 1000000007
long long fact[1000001];
long long gop(long long x,long long y){
x%=je;y%=je;
x*=y;x%=je;
return x;
}
long long hap(long long x,long long y){
x%=je;y%=je;
x+=y;x%=je;
return x;
}
long long div(long long x,long long y){
x%=je;y%=je;
int left=je-2;
long long gopp=y,ret=1;
while(left){
if(left&1){
ret=gop(ret,gopp);
}
gopp=gop(gopp,gopp);
left >>= 1;
}
ret=gop(ret,x);
return ret;
}
int main(){
int n,k;
scanf("%d %d",&n,&k);
fact[0]=1;
for(int i=1;i<=n;i++){
fact[i]=gop(fact[i-1],i);
}
printf("%lld\n",div(div(fact[n],fact[n/2]),fact[n-n/2]));
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |