結果
問題 | No.117 組み合わせの数 |
ユーザー | ciel |
提出日時 | 2015-06-20 03:18:44 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 96 ms / 5,000 ms |
コード長 | 402 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 48,304 KB |
最終ジャッジ日時 | 2024-07-07 04:36:46 |
合計ジャッジ時間 | 1,328 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 8 | for(scanf("%d",&T);T--;){ | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | #define L 2000000 main.c:8:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 8 | for(scanf("%d",&T);T--;){ | ^~~~~ main.c:8:13: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:9:30: warning: format ‘%c’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Wformat=] 9 | 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); | ~^ ~~ | | | | char * int * | %lc main.c:9:55: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 9 | 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); | ^~~~~~ main.c:9:55: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:9:55: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:9:55: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:9:66: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘__int128’ [-Wformat=] 9 | 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); |
ソースコード
#define L 2000000 #define M 1000000007 long long I[L],F[L],R[L]; int C,i,T,N,K; int main(){ for(i=0;i<L;i++)I[i]=F[i]=R[i]=1; for(i=2;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); } }