結果
問題 | No.117 組み合わせの数 |
ユーザー | testestest |
提出日時 | 2016-12-05 12:11:47 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 162 ms / 5,000 ms |
コード長 | 239 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 17,152 KB |
最終ジャッジ日時 | 2024-05-05 20:18:42 |
合計ジャッジ時間 | 889 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルメッセージ
main.c:1:15: warning: data definition has no type or storage class 1 | long f[1<<21];P=1e9+7,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(;~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 ‘c’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,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(;~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 ‘r’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,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(;~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: return type defaults to ‘int’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,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(;~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:80: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | long f[1<<21];P=1e9+7,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(;~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: In function ‘main’: main.c:1:80: warning:
ソースコード
long f[1<<21];P=1e9+7,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(;~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--;}