# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475370 | HossamHero7 | Izbori (COCI17_izbori) | C++14 | 1 ms | 332 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
void solve(){
int n,m,k;
cin>>n>>m>>k;
vector <vector<int>> v(n,vector<int>(m));
for(int i=0;i<n;i++){
for(int j=0;j<m;j++) cin>>v[i][j];
}
for(int i=0;i<m;i++){
map <int,int> mp;
for(int j=0;j<n;j++){
int x = v[j][i];
mp[x] ++;
}
if(i == 0){
ll ans = 0;
int mx = 0;
for(auto j : mp){
mx = max(mx,j.second);
}
for(auto j:mp){
if(j.second == mx){
ans = j.first;
break;
}
}
cout<<ans<<endl;
}
}
cout<<1<<endl;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |