結果

問題 No.117 組み合わせの数
コンテスト
ユーザー ciel
提出日時 2015-07-15 03:25:19
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 177 ms
コンパイル使用メモリ 30,148 KB
最終ジャッジ日時 2026-02-23 18:44:43
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:26: warning: data definition has no type or storage class
    2 | long long I[L],F[L],R[L];C,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",&C);~scanf("\n%c(%d,%d)",&C,&N,&K);)if(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: In function ‘main’:
main.c:2:149: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    2 | long long I[L],F[L],R[L];C,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",&C);~scanf("\n%c(%d,%d)",&C,&N,&K);)if(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:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | #define L 2000000
main.c:2:175: warning: format ‘%c’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Wformat=]
    2 | long long I[L],F[L],R[L];C,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",&C);~scanf("\n%c(%d,%d)",&C,&N,&K);)if(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);}
      |                                                                                                                                                                              ~^         ~~
      |                                                                                                              

ソースコード

diff #
raw source code

#define L 2000000
long long I[L],F[L],R[L];C,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",&C);~scanf("\n%c(%d,%d)",&C,&N,&K);)if(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