Submission #715338

#TimeUsernameProblemLanguageResultExecution timeMemory
715338ToxtaqPoi (IOI09_poi)C++17
0 / 100
652 ms23832 KiB
#include<bits/stdc++.h> using namespace std; struct Person{ int point, num_of_solved, indx; friend bool operator<(Person &a, Person &b){ if(a.point == b.point)return a.num_of_solved < b.num_of_solved; return a.point < b.point; } }; int main() { int n, t, p; cin >> n >> t >> p; vector<vector<int>>v(n + 1, vector<int>(t + 1)); for(int i = 1;i <= n;++i){ for(int j = 1;j <= t;++j){ cin >> v[i][j]; } } vector<int>point_for_each_task(t + 1); for(int i = 1;i <= t;++i){ for(int j = 1;j <= n;++j){ point_for_each_task[i] += (v[j][i] == 0); } } vector<Person>people(n + 1); for(int i = 1;i <= n;++i){ for(int j = 1;j <= t;++j){ if(v[i][j])people[i].point += point_for_each_task[j]; people[i].num_of_solved += (v[i][j] == 1); } people[i].indx = i; } sort(people.begin(), people.end()); for(int i = 1;i <= n;++i){ if(people[i].indx == p){ cout << people[i].point << " " << i; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...