結果
問題 | No.117 組み合わせの数 |
ユーザー | ciel |
提出日時 | 2015-06-20 03:29:25 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 376 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 48,512 KB |
最終ジャッジ日時 | 2024-07-07 04:36:54 |
合計ジャッジ時間 | 587 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルメッセージ
main.c:3:26: warning: data definition has no type or storage class 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^ main.c:3:26: warning: type defaults to ‘int’ in declaration of ‘C’ [-Wimplicit-int] main.c:3:28: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^ main.c:3:30: warning: type defaults to ‘int’ in declaration of ‘T’ [-Wimplicit-int] 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^ main.c:3:32: warning: type defaults to ‘int’ in declaration of ‘N’ [-Wimplicit-int] 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^ main.c:3:34: warning: type defaults to ‘int’ in declaration of ‘K’ [-Wimplicit-int] 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^ main.c:3:36: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | long long I[L],F[L],R[L];C,i,T,N,K;main(){ | ^~~~ main.c: In function ‘main’: main.c:6:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 6 | for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&K==0?1:N<K?0:(__int128_t)F[N]*R[K]*R[N-K]%M,N=C-67?N+K-1:N);else printf("%lld\n",N<K?0:F[N]*R[N-K]%M); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | #define L 2000000 main.c:6:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 6 | for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&K==0?1:N<K?0:(__int128_t)F[N]*R[K]*R[N-K]%M,N=C-67?N+K-1:N);else printf("%lld\n",N<K?0:F[N]*R[N-K]%M); | ^~~~~ m
ソースコード
#define L 2000000 #define M 1000000007 long long I[L],F[L],R[L];C,i,T,N,K;main(){ for(;i<1;i++)I[i]=F[i]=R[i]=1; for(;i<L;i++)I[i]=(M-M/i)*I[M%i]%M,F[i]=i*F[i-1]%M,R[i]=I[i]*R[i-1]%M; for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&K==0?1:N<K?0:(__int128_t)F[N]*R[K]*R[N-K]%M,N=C-67?N+K-1:N);else printf("%lld\n",N<K?0:F[N]*R[N-K]%M); }