Submission #568623

#TimeUsernameProblemLanguageResultExecution timeMemory
568623TomkeMonkePoi (IOI09_poi)C++17
15 / 100
586 ms23796 KiB
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e3 + 7;

int tab[MAXN][MAXN];

int scores[MAXN];

int main(){
	
	int n, t, p;
	cin >> n >> t >> p;
	
	for(int i = 1; i <= n; i++){
		
		for(int j = 1; j <= t; j++){
		
			cin >> tab[i][j];
		}	
	}
	
	//for(int j = 1; j <= t; j++)
	//	cout << tab[p][j] << endl;
	
	int res = 0;
	
	for(int i = 1; i <= t; i++){
		
		res = 0;
		
		for(int j = 1; j <= n; j++){
		
			if(tab[j][i] == 0) res++;
		}
		
		for(int j = 1; j <= n; j++){
		
			if(tab[j][i] == 1) scores[j] += res;
		}
	}
	
	cout << scores[p] << " ";
	
	//for(int i = 1; i <= n; i++) 
	//	cout << scores[i] << " ";
		
	//cout << endl;	
	
	res = scores[p];
	
	sort(scores + 1, scores + n + 1);
	
	for(int i = 1; i <= n; i++){
		
		if(scores[i] == res){
			
			cout << (n - i - 1) << endl;
			break;
		}
		
	}
		
	
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...