結果
問題 | No.801 エレベーター |
ユーザー | kotatsugame |
提出日時 | 2019-03-18 00:56:57 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 30,080 KB |
実行使用メモリ | 72,192 KB |
最終ジャッジ日時 | 2024-07-08 07:53:05 |
合計ジャッジ時間 | 7,229 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 6 ms
5,376 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 6 ms
5,376 KB |
testcase_09 | AC | 6 ms
5,376 KB |
testcase_10 | AC | 5 ms
5,376 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 353 ms
72,064 KB |
testcase_17 | AC | 346 ms
71,936 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 345 ms
72,192 KB |
testcase_22 | WA | - |
testcase_23 | AC | 382 ms
72,064 KB |
testcase_24 | AC | 375 ms
72,064 KB |
testcase_25 | AC | 376 ms
72,064 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 388 ms
72,192 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | L[3000],R[3000],i,j; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'L' [-Wimplicit-int] main.c:2:9: warning: type defaults to 'int' in declaration of 'R' [-Wimplicit-int] 2 | L[3000],R[3000],i,j; | ^ main.c:2:17: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 2 | L[3000],R[3000],i,j; | ^ main.c:2:19: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 2 | L[3000],R[3000],i,j; | ^ main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] 3 | main(n,m,k){ | ^~~~ main.c: In function 'main': main.c:3:1: warning: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'k' defaults to 'int' [-Wimplicit-int] main.c:4:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d%d%d",&n,&m,&k); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | long mod=1e9+7,dp[3002][3002],W; main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d%d%d",&n,&m,&k); | ^~~~~ main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:14:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 14 | printf("%d",dp[k][n]); | ^~~~~~ main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
long mod=1e9+7,dp[3002][3002],W; L[3000],R[3000],i,j; main(n,m,k){ scanf("%d%d%d",&n,&m,&k); for(dp[0][1]=1;~scanf("%d%d",L+j++,R+j);); for(;i<k;i++){ for(j=0;j++<n;)dp[i][j]=(dp[i][j]+dp[i][j-1])%mod; for(j=0;j<m;j++){ dp[i+1][L[j]]+=W=dp[i][R[j]]-dp[i][L[j]-1]; dp[i+1][R[j]+1]-=W; } for(j=0;j++<n;)dp[i+1][j]=(dp[i+1][j]+dp[i+1][j-1])%mod; } printf("%d",dp[k][n]); }