結果

問題 No.391 CODING WAR
ユーザー testestesttestestest
提出日時 2016-07-19 03:52:20
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 25,092 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 02:47:48
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 260 ms
4,376 KB
testcase_10 AC 259 ms
4,376 KB
testcase_11 AC 212 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 255 ms
4,380 KB
testcase_14 AC 188 ms
4,376 KB
testcase_15 AC 222 ms
4,380 KB
testcase_16 AC 124 ms
4,376 KB
testcase_17 AC 155 ms
4,376 KB
testcase_18 AC 100 ms
4,380 KB
testcase_19 AC 102 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
 P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
 ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘P’ [-Wimplicit-int]
main.c:1:18: warning: data definition has no type or storage class
 P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
                  ^
main.c:1:18: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int]
main.c:1:20: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
 P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
                    ^
main.c: In function ‘p’:
main.c:1:27: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
 P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
                           ^
main.c:1:27: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c: At top level:
main.c:1:74: warning: return type defaults to ‘int’ [-Wimplicit-int]
 P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
                                                                          ^~~~
main.c: In function ‘main’:
main.c:1:74: warning: type of ‘t’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:86: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declarati

ソースコード

diff #

P=1e9+7;long n,s;m,i;long p(a,i){return i?p(1L*a*a%P,i/2)*(i%2?a:1)%P:1;}main(t){for(scanf("%ld%d",&n,&m);m/++i;)s+=p(-1,m-i)*(t=t*p(i,P-2)%P*(m-i+1)%P)*p(i,n%~-P)%P+P;s=!printf("%d",s%P);}
0