Submission #328430

#TimeUsernameProblemLanguageResultExecution timeMemory
328430israeladewuyiPoi (IOI09_poi)C++17
0 / 100
331 ms23840 KiB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
#define PB push_back
#define pb pop_back
 
 
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, t, p; cin>>n>>t>>p;
	
	int arr[n][t];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < t; j++){
			cin >> arr[i][j];
		}
	}
	vi v,w;
	for(int i = 0; i < t; i++){
		int nu = 0;
		for(int j = 0; j < n; j++){
			if(arr[j][i] == 0) nu++;
		}
		v.PB(nu);
	}
	for(int i = 0; i < n ; i++){
		int tt = 0;
		for(int j = 0; j < t; j++){
			int t;
			t = arr[i][j] * v[j];
			tt += t;
		}
		w.PB(tt);
	}
	int score = w[p - 1];
	cout<<score<<" ";
	sort(w.begin(), w.end());
	for(int i = 0; i < n; i++){
		if(w[i] == score){
			cout<<i + 1;
			exit(0);
		}
	} 
	return 0;
}
 
#Verdict Execution timeMemoryGrader output
Fetching results...