You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
514 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <bits/stdc++.h>
using namespace std;
/*
20190925
csp试题1小明种苹果
*/
int main() {
int n, m;
cin >> n >> m;
int f = 0, sum = 0, ma = 0;
for (int i = 1, a; i <= n; i++) {
cin >> a;
sum += a;
int ans = 0;
for (int j = 1, x; j <= m; j++) {
cin >> x;
ans += x;
}
ans = -ans;
sum -= ans;
if (ma < ans) ma = ans, f = i;
}
cout << sum << " " << f << " " << ma;
}