-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathI092.java
34 lines (32 loc) · 1.06 KB
/
I092.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class I092 {
public static void main(String[] args) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] str=br.readLine().split(" ");
int N=Integer.parseInt(str[0]);
int M=Integer.parseInt(str[1]);
int a[]=new int[N];
for(int i=0;i<M;i++){
String[] temp=br.readLine().split(" ");
for(int j=0;j<temp.length;j++)
a[j]+=Integer.parseInt(temp[j]);
}
int max=0;
for(int i=0;i<N;i++)
if(max<a[i])
max=a[i];
ArrayList<Integer> list=new ArrayList<>();
for(int i=0;i<N;i++)
if(a[i]==max)
list.add(i);
System.out.println(max);
for(int i=0;i<list.size();i++){
System.out.print(list.get(i)+1);
if(i!=list.size()-1)
System.out.print(" ");
}
}
}