-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path416B.cpp
More file actions
42 lines (42 loc) · 834 Bytes
/
416B.cpp
File metadata and controls
42 lines (42 loc) · 834 Bytes
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
36
37
38
39
40
41
42
#include <iostream>
#include <string>
#include <streambuf>
#include <fstream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <map>
#include <set>
#include <stdlib.h>
#include <cstdio>
#include <vector>
#include <queue>
#include <math.h>
using namespace std;
long long sum=0;
int a[10]={0};
vector <int> ans;
int main()
{
int numb,t,n,m,count=0,s;
cin >> m>>n;
for(int i=0;i<m;i++)
{
int t=0;
for(int j=0;j<n;j++)
{
scanf("%d",&numb);
s=max(a[j],t);
t=s+numb;
a[j]=t;
}
ans.push_back(t);
}
for(int i=0;i<ans.size()-1;i++)
cout << ans[i] << " ";
cout << ans[ans.size()-1];
return 0;
}