Submission #37415
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int dp[1005][1005]; int main(){ int h,w,a,b; scanf ( "%d %d" ,&h,&w); for ( int i=1;i<=h;i++){ for ( int j=1;j<=w;j++){ scanf ( "%d" ,&dp[i][j]); } } for ( int i=1;i<=h;i++){ for ( int j=1;j<=w;j++){ dp[i][j]=max(dp[i][j]+dp[i-1][j],dp[i][j]+dp[i][j-1]); } } printf ( "%d\n" ,dp[h][w]); return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0910 - 百円以下の拾得物 |
ユーザー名 | ei1728 |
投稿日時 | 2018-06-15 17:50:24 |
言語 | C++11 |
状態 | Accepted |
得点 | 3 |
ソースコード長 | 434 Byte |
最大実行時間 | 88 ms |
最大メモリ使用量 | 4400 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 3 / 3 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 26 ms | 480 KB |
1
|
in02.txt | AC | 23 ms | 688 KB |
1
|
in03.txt | AC | 25 ms | 496 KB |
1
|
in04.txt | AC | 18 ms | 444 KB |
1
|
in05.txt | AC | 24 ms | 408 KB |
1
|
in06.txt | AC | 77 ms | 4344 KB |
1
|
in07.txt | AC | 75 ms | 4364 KB |
1
|
in08.txt | AC | 77 ms | 4384 KB |
1
|
in09.txt | AC | 88 ms | 4400 KB |
1
|
in10.txt | AC | 25 ms | 964 KB |
1
|
in11.txt | AC | 63 ms | 3524 KB |
1
|
sample_in_1.txt | AC | 24 ms | 632 KB |
1
|
sample_in_2.txt | AC | 30 ms | 464 KB |
1
|