Submission #41901


ソースコード

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 FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
int dx[]={1,0,-1,0};
int dy[]={0,-1,0,1};
int dxx[]={1,1,0,-1,-1,-1,0,1};
int dyy[]={0,-1,-1,-1,0,1,1,1};
bool inside(int x,int y,int w,int h){
return (x>=0 && y>=0 && x<w && y<h);}
typedef long long ll;
typedef pair<int,int> pii;
int main(){
cin.tie(0), ios::sync_with_stdio(false);
int x,h,w,a[1005]={};
cin >>h>>w;
iFOR(i,1,h+1){
iFOR(j,1,w+1){
cin >>x;
a[j]=max(a[j],a[j-1])+x;
}
}
cout <<a[w]<<endl;
return 0;
}

ステータス

項目 データ
問題 0910 - 百円以下の拾得物
ユーザー名 ei1821
投稿日時 2018-08-26 08:53:42
言語 C++11
状態 Accepted
得点 3
ソースコード長 662 Byte
最大実行時間 69 ms
最大メモリ使用量 656 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 40 ms 480 KB
1
in02.txt AC 27 ms 444 KB
1
in03.txt AC 31 ms 524 KB
1
in04.txt AC 29 ms 480 KB
1
in05.txt AC 21 ms 564 KB
1
in06.txt AC 65 ms 656 KB
1
in07.txt AC 63 ms 608 KB
1
in08.txt AC 68 ms 564 KB
1
in09.txt AC 69 ms 648 KB
1
in10.txt AC 20 ms 476 KB
1
in11.txt AC 49 ms 564 KB
1
sample_in_1.txt AC 24 ms 652 KB
1
sample_in_2.txt AC 20 ms 616 KB
1