제출 #1088449

#제출 시각아이디문제언어결과실행 시간메모리
1088449vjudge1Izbori (COCI17_izbori)C++17
26 / 80
1 ms460 KiB
#include <bits/stdc++.h>
using namespace std;
#define fastinput cin.tie(nullptr)->sync_with_stdio(false);
#define endl '\n'
#define ll long long
const ll mOd=1e9+7;
const int mAx=INT_MAX;
const int nUm=1e3+3;
int main()
{
	fastinput;
	ll n,m,k; cin>>n>>m>>k;
	vector<pair<ll,ll>>p(m);
	for(int i=0 ; i<m ; i++)p[i].first=0,p[i].second=i+1;
	for(int i=0 ; i<n ; i++){
		for(int j=0 ; j<m ; j++){
			ll x; cin>>x; x--;
			p[x].first+=j;
		}
	}
	sort(p.begin(),p.end());
	cout<<p[0].second<<endl;
	for(int i=0 ; i<m ; i++){
		if(p[i].second==k)
		{
			cout<<i<<endl;
			break;
		}
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...