'commit'
This commit is contained in:
26
TangDou/XiTi/1317.cpp
Normal file
26
TangDou/XiTi/1317.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user