题目描述
摘花生,极致简短版
样例
#include<cstring>
#include<iostream>
using namespace std;
const int N = 105;
int f[N], q, n, m;
int main()
{
cin >> q;
while(q--){
cin >> n >> m;
int a;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cin >> a;
f[j] = max(f[j], f[j-1]) + a;
}
}
cout << f[m] << endl;
memset(f,0,sizeof(f));
}
}