import java.io.*;
import java.util.*;
public class Main
{
public Main() throws IOException
{
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(f.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
int T = 0, k = 0, P = 0;;
int[] a = new int[N + 1];
for (int i = 1; i <= N; i++)
{
st = new StringTokenizer(f.readLine());
int apples = Integer.parseInt(st.nextToken());
int bad_apples = 0;
for (int j = 0; j < M; j++)
{
bad_apples -= Integer.parseInt(st.nextToken());
}
a[i] = bad_apples;
T += apples - bad_apples;
if (a[k] < a[i])
{
k = i;
P = bad_apples;
}
}
out.println(T + " " + k + " " + P);
out.close();
f.close();
}
public static void main(String[] args) throws IOException {
new Main();
}
}
[Java] 201909-1 小明种苹果
最新推荐文章于 2022-09-17 23:48:37 发布