Submission #00032
ソースコード
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 34 35 | #include<bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define all(v2) v2.begin(),v2.end() #define fi first #define se second #define P pair<int,int> #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) int mod=1e9+7; int inf=INT_MAX; //cout<<fixed<<setprecision(5); int main(){ cin.tie(nullptr); ios_base::sync_with_stdio( false ); int h,w; cin>>h>>w; vector<vector< int >> a(h+1,vector< int >(w+1,0)); for ( int i=1;i<=h;i++){ for ( int j=1;j<=w;j++){ int x; cin>>x; a[i][j]=max(a[i-1][j],a[i][j-1])+x; } } cout<<a[h][w]<< "\n" ; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - 百円以下の拾得物 |
ユーザー名 | ei2005 |
投稿日時 | 2022-05-23 17:17:31 |
言語 | C++17 |
状態 | Accepted |
得点 | 3 |
ソースコード長 | 688 Byte |
最大実行時間 | 71 ms |
最大メモリ使用量 | 4660 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 3 / 3 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 26 ms | 604 KB |
1
|
in02.txt | AC | 16 ms | 560 KB |
1
|
in03.txt | AC | 17 ms | 388 KB |
1
|
in04.txt | AC | 17 ms | 468 KB |
1
|
in05.txt | AC | 18 ms | 552 KB |
1
|
in06.txt | AC | 66 ms | 4476 KB |
1
|
in07.txt | AC | 69 ms | 4440 KB |
1
|
in08.txt | AC | 70 ms | 4660 KB |
1
|
in09.txt | AC | 71 ms | 4500 KB |
1
|
in10.txt | AC | 23 ms | 624 KB |
1
|
in11.txt | AC | 51 ms | 3072 KB |
1
|
sample_in_1.txt | AC | 20 ms | 600 KB |
1
|
sample_in_2.txt | AC | 24 ms | 680 KB |
1
|