前言
-
感谢 @潘潘_the_panda 同学给我推荐水题(
-
这么水的一道题目,为什么没有人发题解¿
正题
由于题目过于简单,直接给出代码注释罢了(
code:
#include <bits/stdc++.h>
using namespace std;
signed main() {
int n, m, maxx = -0x7ffffff, maxxid = 0, res = 0;//懒得打全局了
scanf ("%d%d", &n, &m);
for (int i = 1; i <= n; i ++) {
int x, sum = 0;
scanf ("%d", &x);
for (int j = 1; j <= m; j ++) {
int y;
scanf ("%d", &y);
sum += abs (y);//因为题目迷惑人类的非正数,所以要加绝对值。
}
res += (x - sum);
if (sum > maxx) {
maxx = sum;
maxxid = i;
}
}
printf ("%d %d %d", res, maxxid, maxx);
return 0;
}
咩