Submission #931380

#TimeUsernameProblemLanguageResultExecution timeMemory
931380thisisadarshPoi (IOI09_poi)C++14
5 / 100
482 ms23808 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int N, T, P; cin >> N >> T >> P; vector<vector<int>> a(N, vector<int> (T,0)); vector<int>score(T,0); for(int i = 0; i < N; i++){ for(int j = 0; j < T; j++){ cin >> a[i][j]; } } for(int i = 0; i < T; i++){ for(int j = 0; j < N; j++){ if(a[j][i] == 0){ score[i]++; } } } vector<pair<int, int>>player_score(N); for(int i = 0; i < N; i++){ player_score[i].second = i+1; } for(int i = 0; i < N; i++){ for(int j = 0; j < T; j++){ if(a[i][j] != 0){ player_score[i].first += score[j]; } } } sort(player_score.begin(), player_score.end()); for(int i = 0; i < N; i++){ if(player_score[i].second == P){ cout << player_score[i].first << ' ' << i + 1 << '\n'; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...