結果
問題 | No.801 エレベーター |
ユーザー | kotatsugame |
提出日時 | 2019-03-18 01:03:43 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 410 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 426 ms |
コンパイル使用メモリ | 30,336 KB |
実行使用メモリ | 72,268 KB |
最終ジャッジ日時 | 2024-07-08 07:54:22 |
合計ジャッジ時間 | 7,503 ms |
ジャッジサーバーID (参考情報) |
judge2 / 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 | 6 ms
5,376 KB |
testcase_04 | AC | 6 ms
5,376 KB |
testcase_05 | AC | 6 ms
5,376 KB |
testcase_06 | AC | 6 ms
5,376 KB |
testcase_07 | AC | 7 ms
5,376 KB |
testcase_08 | AC | 6 ms
5,376 KB |
testcase_09 | AC | 7 ms
5,376 KB |
testcase_10 | AC | 7 ms
5,376 KB |
testcase_11 | AC | 6 ms
5,376 KB |
testcase_12 | AC | 5 ms
5,376 KB |
testcase_13 | AC | 397 ms
72,064 KB |
testcase_14 | AC | 404 ms
72,172 KB |
testcase_15 | AC | 409 ms
71,936 KB |
testcase_16 | AC | 400 ms
72,064 KB |
testcase_17 | AC | 399 ms
72,024 KB |
testcase_18 | AC | 394 ms
72,064 KB |
testcase_19 | AC | 403 ms
72,192 KB |
testcase_20 | AC | 403 ms
72,108 KB |
testcase_21 | AC | 403 ms
72,064 KB |
testcase_22 | AC | 410 ms
72,192 KB |
testcase_23 | AC | 410 ms
72,112 KB |
testcase_24 | AC | 410 ms
71,936 KB |
testcase_25 | AC | 407 ms
71,936 KB |
testcase_26 | AC | 408 ms
72,192 KB |
testcase_27 | AC | 409 ms
72,048 KB |
testcase_28 | AC | 408 ms
72,268 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]+=mod-W%mod; } for(j=0;j++<n;)dp[i+1][j]=(dp[i+1][j]+dp[i+1][j-1])%mod; } printf("%d",dp[k][n]); }