问题描述
思路
完整代码
#include<iostream>
using namespace std;
const int Max = 1e9+1;
int main()
{
int N, M;
cin >> N >> M;
int a[N];
int b[N][M];
int c[N] = {0};
int max_amount = 0;
int max_number = 0;
for( int i = 0; i < N; i++ )
{
cin >> a[i];
for( int j = 0; j < M; j++)
{
cin >> b[i][j];
c[i] -= b[i][j];
}
if( c[i] > max_amount)
{
max_amount = c[i];
max_number = i+1;
}
}
int apple = 0;
int shuguo = 0;
for( int i = 0; i < N; i++)
{
apple += a[i];
shuguo += c[i];
}
cout << apple - shuguo << ' ' << max_number << ' '<< max_amount ;
return 0;
}
提交截图