結果
問題 | No.117 組み合わせの数 |
ユーザー | 👑 testestest |
提出日時 | 2017-03-02 04:01:05 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 151 ms / 5,000 ms |
コード長 | 236 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 17,124 KB |
最終ジャッジ日時 | 2024-06-12 23:16:25 |
合計ジャッジ時間 | 1,030 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
コンパイルメッセージ
main.c:1:17: warning: data definition has no type or storage class 1 | long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k]*(c%5?f[k]:1)%P,P-2),k*f[n]%P:0))c&8&&(n+=k)&&n--;} | ^ main.c:1:17: warning: type defaults to ‘int’ in declaration of ‘P’ [-Wimplicit-int] main.c:1:25: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int] 1 | long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k]*(c%5?f[k]:1)%P,P-2),k*f[n]%P:0))c&8&&(n+=k)&&n--;} | ^ main.c:1:27: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int] 1 | long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k]*(c%5?f[k]:1)%P,P-2),k*f[n]%P:0))c&8&&(n+=k)&&n--;} | ^ main.c:1:29: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k]*(c%5?f[k]:1)%P,P-2),k*f[n]%P:0))c&8&&(n+=k)&&n--;} | ^ main.c: In function ‘p’: main.c:1:29: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int] main.c:1:29: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:1:71: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k
ソースコード
long f[1<<21],k;P=1e9+7,x,c;p(a,i){k=i?p(1L*a*a%P,i/2),i%2?k*a%P:k:1;}main(n){for(gets(f),*f=1;k++<2e6;f[k]=f[k-1]*k%P);for(;x=~scanf(" %c(%d,%ld)",&c,&n,&k);printf("%d\n",n>=k?p(f[n-k]*(c%5?f[k]:1)%P,P-2),k*f[n]%P:0))c&8&&(n+=k)&&n--;}