简单题:直接模拟就可以了!
代码如下:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,T,K,P,sum1 = 0,badapple = 0,s,bad_apple=0,badapp1=0;
cin >> n >> m;
for(int i = 1; i <= n; i++){
for(int j = 0; j <= m; j++){
cin>>s;
if(j == 0) sum1+=s;//未蔬果总数
else badapple+=abs(s);
}
badapp1 += badapple;//坏苹果总数
if(bad_apple < badapple){
bad_apple = badapple;//最大疏果总数
K = i;//最大疏果编号
}
badapple = 0;
}
T = sum1-badapp1;
P = bad_apple;
cout << T << " " << K << " " << P;
return 0;
}