結果
問題 | No.801 エレベーター |
ユーザー | kotatsugame |
提出日時 | 2019-03-18 00:58:56 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 392 bytes |
コンパイル時間 | 309 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 72,192 KB |
最終ジャッジ日時 | 2024-07-08 07:54:12 |
合計ジャッジ時間 | 7,151 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | AC | 5 ms
5,376 KB |
testcase_04 | AC | 4 ms
5,376 KB |
testcase_05 | AC | 5 ms
5,376 KB |
testcase_06 | AC | 5 ms
5,376 KB |
testcase_07 | AC | 5 ms
5,376 KB |
testcase_08 | AC | 5 ms
5,376 KB |
testcase_09 | AC | 5 ms
5,376 KB |
testcase_10 | AC | 4 ms
5,376 KB |
testcase_11 | AC | 5 ms
5,376 KB |
testcase_12 | AC | 5 ms
5,376 KB |
testcase_13 | AC | 338 ms
72,064 KB |
testcase_14 | WA | - |
testcase_15 | AC | 327 ms
72,064 KB |
testcase_16 | AC | 325 ms
71,936 KB |
testcase_17 | AC | 328 ms
71,936 KB |
testcase_18 | AC | 319 ms
71,936 KB |
testcase_19 | AC | 333 ms
72,192 KB |
testcase_20 | AC | 329 ms
72,064 KB |
testcase_21 | AC | 327 ms
72,064 KB |
testcase_22 | AC | 323 ms
72,064 KB |
testcase_23 | AC | 350 ms
72,064 KB |
testcase_24 | AC | 345 ms
72,064 KB |
testcase_25 | AC | 354 ms
71,936 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 360 ms
72,064 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | L[3001],R[3001],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[3001],R[3001],i,j; | ^ main.c:2:17: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 2 | L[3001],R[3001],i,j; | ^ main.c:2:19: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 2 | L[3001],R[3001],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[3001],R[3001],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)%mod; } printf("%d",dp[k][n]); }