-
Notifications
You must be signed in to change notification settings - Fork 7
/
Chapter11
60 lines (49 loc) · 853 Bytes
/
Chapter11
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n,s,i,j;
cin >> n >> s;
ll a[s][n];
for(i=0;i<s;i++){
for(j=0;j<n;j++){
cin >> a[i][j];
}
}
/*
for(i=0;i<s;i++){
for(j=0;j<n;j++){
cout << a[i][j] << " ";
}
cout << endl;
}
*/
ll as[n];
for(i=0;i<n;i++){
as[i]=0;
}
ll maxa = 0;
ll k;
for(j=0;j<s;j++){
maxa = 0;
k = 0;
for(i=0;i<n;i++){
if(maxa<a[j][i]){
maxa = a[j][i];
k = i;
}
}
as[k]++;
}
maxa = 0;
ll ans = 0;
for(i=0;i<n;i++){
if(maxa<as[i]){
maxa = as[i];
ans = i;
}
}
cout << ans+1 << endl;
}