Submission #54885


ソースコード

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
27
28
29
30
31
32
33
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
//#define int long long
using pii = pair<int,int>;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1000000007;
vector<vector<int> > mas(1050,vector<int>(1050));
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int h,w;
cin >> h >> w;
reps(i,h){
reps(j,w){
cin >> mas[i][j];
}
}
reps(i,h){
reps(j,w){
mas[i][j] = mas[i][j] + max(mas[i-1][j],mas[i][j-1]);
}
}
cout << mas[h][w] << '\n';
return 0;
}

ステータス

項目 データ
問題 0910 - 百円以下の拾得物
ユーザー名 ei1903
投稿日時 2019-09-15 20:49:22
言語 C++14
状態 Accepted
得点 3
ソースコード長 686 Byte
最大実行時間 69 ms
最大メモリ使用量 4992 KB

セット

セット 得点 Cases
1 ALL 3 / 3 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 25 ms 4956 KB
1
in02.txt AC 25 ms 4788 KB
1
in03.txt AC 33 ms 4756 KB
1
in04.txt AC 22 ms 4852 KB
1
in05.txt AC 24 ms 4688 KB
1
in06.txt AC 64 ms 4908 KB
1
in07.txt AC 66 ms 4992 KB
1
in08.txt AC 68 ms 4816 KB
1
in09.txt AC 69 ms 4904 KB
1
in10.txt AC 18 ms 4860 KB
1
in11.txt AC 53 ms 4952 KB
1
sample_in_1.txt AC 29 ms 4912 KB
1
sample_in_2.txt AC 25 ms 4872 KB
1