Submission #475372

# Submission time Handle Problem Language Result Execution time Memory
475372 2021-09-22T08:48:46 Z Ahmed57 Izbori (COCI17_izbori) C++14
44 / 80
1 ms 204 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    int arr[n][m];
    for(int i = 0;i<n;i++)for(int j = 0;j<m;j++)cin>>arr[i][j];
    for(int i=0;i<m;i++){
        map<int,int>mp;
        for(int j = 0;j<n;j++){
            mp[arr[j][i]]++;
        }
        if(i==0){
        long long ans = 0;
        int ma=0;
        for(auto j:mp){
            ma = max(ma,j.second);
        }
        for(auto j:mp){
            if(j.second==ma){
                ans=j.first;
                break;
            }
        }
        cout<<ans<<endl;
        }
    }
    cout<<1<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially correct
2 Partially correct 0 ms 204 KB Partially correct
3 Correct 1 ms 204 KB Output is correct
4 Partially correct 1 ms 204 KB Partially correct
5 Partially correct 1 ms 204 KB Partially correct
6 Partially correct 0 ms 204 KB Partially correct
7 Partially correct 1 ms 204 KB Partially correct
8 Partially correct 0 ms 204 KB Partially correct
9 Partially correct 1 ms 204 KB Partially correct
10 Partially correct 0 ms 204 KB Partially correct
11 Partially correct 1 ms 204 KB Partially correct
12 Partially correct 1 ms 204 KB Partially correct
13 Partially correct 1 ms 204 KB Partially correct
14 Partially correct 1 ms 204 KB Partially correct
15 Correct 1 ms 204 KB Output is correct
16 Partially correct 1 ms 204 KB Partially correct
17 Partially correct 1 ms 204 KB Partially correct
18 Partially correct 1 ms 204 KB Partially correct
19 Partially correct 1 ms 204 KB Partially correct
20 Partially correct 1 ms 204 KB Partially correct