結果
問題 | No.117 組み合わせの数 |
ユーザー | testestest |
提出日時 | 2016-12-05 12:11:02 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 164 ms / 5,000 ms |
コード長 | 243 bytes |
コンパイル時間 | 514 ms |
コンパイル使用メモリ | 21,888 KB |
実行使用メモリ | 17,024 KB |
最終ジャッジ日時 | 2024-05-05 20:18:41 |
合計ジャッジ時間 | 901 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
コンパイルメッセージ
main.c:1:15: warning: data definition has no type or storage class 1 | long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;} | ^ main.c:1:15: warning: type defaults to ‘int’ in declaration of ‘P’ [-Wimplicit-int] main.c:1:23: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;} | ^ main.c:1:25: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;} | ^ main.c:1:27: warning: type defaults to ‘int’ in declaration of ‘r’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;} | ^ main.c:1:29: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;} | ^ main.c:1:82: warning: return type defaults to ‘int’ [-Wimplicit-
ソースコード
long f[1<<21];P=1e9+7,x,c,r;p(long a,int i){return i?p(a*a%P,i/2)*(i%2?a:1)%P:1;}main(n){for(gets(f),*f=n;r++<2e6;f[r]=f[r-1]*r%P);for(;x=~scanf(" %c(%d,%d)",&c,&n,&r);printf("%d\n",n<r?0:f[n]*p(f[n-r]*(c%5?f[r]:1)%P,P-2)%P))c&8&&(n+=r)&&n--;}