結果

問題 No.117 組み合わせの数
ユーザー cielciel
提出日時 2015-06-20 03:36:12
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 274 ms / 5,000 ms
コード長 351 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 24,644 KB
実行使用メモリ 48,664 KB
最終ジャッジ日時 2023-09-21 10:32:02
合計ジャッジ時間 1,165 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 274 ms
48,664 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:26: warning: data definition has no type or storage class
 long long I[L],F[L],R[L];C,T,K,M=1000000007;main(N){for(*I=*F=*R=I[1]=F[1]=R[1]=1;++N<L;)I[N]=(M-M/N)*I[M%N]%M,F[N]=N*F[N-1]%M,R[N]=I[N]*R[N-1]%M;for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&!K?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:2:26: warning: type defaults to ‘int’ in declaration of ‘C’ [-Wimplicit-int]
main.c:2:28: warning: type defaults to ‘int’ in declaration of ‘T’ [-Wimplicit-int]
 long long I[L],F[L],R[L];C,T,K,M=1000000007;main(N){for(*I=*F=*R=I[1]=F[1]=R[1]=1;++N<L;)I[N]=(M-M/N)*I[M%N]%M,F[N]=N*F[N-1]%M,R[N]=I[N]*R[N-1]%M;for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&!K?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:2:30: warning: type defaults to ‘int’ in declaration of ‘K’ [-Wimplicit-int]
 long long I[L],F[L],R[L];C,T,K,M=1000000007;main(N){for(*I=*F=*R=I[1]=F[1]=R[1]=1;++N<L;)I[N]=(M-M/N)*I[M%N]%M,F[N]=N*F[N-1]%M,R[N]=I[N]*R[N-1]%M;for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&!K?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:2:32: warning: type defaults to ‘int’ in declaration of ‘M’ [-Wimplicit-int]
 long long I[L],F[L],R[L];C,T,K,M=1000000007;main(N){for(*I=*F=*R=I[1]=F[1]=R[1]=1;++N<L;)I[N]=(M-M/N)*I[M%N]%M,F[N]=N*F[N-1]%M,R[N]=I[N]*R[N-1]%M;for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&!K?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:2:45: warning: return type defaults to ‘int’ [-Wimplicit-int]
 long long I[L],F[L],R[L];C,T,K,

ソースコード

diff #

#define L 2000000
long long I[L],F[L],R[L];C,T,K,M=1000000007;main(N){for(*I=*F=*R=I[1]=F[1]=R[1]=1;++N<L;)I[N]=(M-M/N)*I[M%N]%M,F[N]=N*F[N-1]%M,R[N]=I[N]*R[N-1]%M;for(scanf("%d",&T);T--;)if(scanf("\n%c(%d,%d)",&C,&N,&K),C-80)printf("%lld\n",N==-1&&!K?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);}
0