Submission #20022

# Submission time Handle Problem Language Result Execution time Memory
20022 2016-02-25T08:40:24 Z jihoon 괄호 (kriii4_R) C++
8 / 100
15 ms 8896 KB
#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
1 Correct 5 ms 8896 KB Output is correct
2 Correct 1 ms 8896 KB Output is correct
3 Correct 11 ms 8896 KB Output is correct
4 Correct 12 ms 8896 KB Output is correct
5 Correct 13 ms 8896 KB Output is correct
6 Correct 7 ms 8896 KB Output is correct
7 Correct 8 ms 8896 KB Output is correct
8 Correct 0 ms 8896 KB Output is correct
9 Correct 0 ms 8896 KB Output is correct
10 Correct 0 ms 8896 KB Output is correct
11 Correct 0 ms 8896 KB Output is correct
12 Correct 12 ms 8896 KB Output is correct
13 Correct 7 ms 8896 KB Output is correct
14 Correct 5 ms 8896 KB Output is correct
15 Correct 5 ms 8896 KB Output is correct
16 Correct 5 ms 8896 KB Output is correct
17 Correct 14 ms 8896 KB Output is correct
18 Correct 14 ms 8896 KB Output is correct
19 Correct 3 ms 8896 KB Output is correct
20 Correct 15 ms 8896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 8896 KB Output isn't correct
2 Halted 0 ms 0 KB -