結果
問題 | No.391 CODING WAR |
ユーザー | testestest |
提出日時 | 2016-07-17 18:18:25 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 209 ms / 2,000 ms |
コード長 | 292 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 15:24:58 |
合計ジャッジ時間 | 2,345 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 0 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 0 ms
5,248 KB |
testcase_09 | AC | 209 ms
5,248 KB |
testcase_10 | AC | 206 ms
5,248 KB |
testcase_11 | AC | 128 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | AC | 178 ms
5,248 KB |
testcase_14 | AC | 139 ms
5,248 KB |
testcase_15 | AC | 159 ms
5,248 KB |
testcase_16 | AC | 98 ms
5,248 KB |
testcase_17 | AC | 120 ms
5,248 KB |
testcase_18 | AC | 79 ms
5,248 KB |
testcase_19 | AC | 82 ms
5,248 KB |
コンパイルメッセージ
main.c:3:10: warning: data definition has no type or storage class 3 | ll n,s,t;m,i; | ^ main.c:3:10: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int] main.c:3:12: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 3 | ll n,s,t;m,i; | ^ main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 5 | main(){ | ^~~~ main.c: In function ‘main’: main.c:6:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 6 | scanf("%lld%d",&n,&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | #define ll long long main.c:6:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 6 | scanf("%lld%d",&n,&m); | ^~~~~ main.c:6:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:10:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 10 | s=!printf("%d",s%P); | ^~~~~~ main.c:10:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:10:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:10:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:10:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 10 | s=!printf("%d",s%P); | ~^ | | | int | %lld
ソースコード
#define ll long long #define P 1000000007 ll n,s,t;m,i; ll pom(ll a,ll i,ll m){return i?i%2?pom(a*a%m,i/2,m)*a%m:pom(a*a%m,i/2,m)%m:1;} main(){ scanf("%lld%d",&n,&m); s=pom(m,n,P); t=1; for(i=1;i<m;i++)s+=(i%2?-1:1)*(t=t*(m-i+1)%P*pom(i,P-2,P)%P)*pom(m-i,n,P)%P+P; s=!printf("%d",s%P); }