Submission #300259

#TimeUsernameProblemLanguageResultExecution timeMemory
300259fpc_coderPoi (IOI09_poi)C++17
0 / 100
1122 ms16244 KiB
#include <bits/stdc++.h> using namespace std; const int N = 2005; int status[N][N], task_score[N]; pair<int, int> contestant[N]; bool cmp(pair<int, int> a, pair<int, int> b) { if (a.first != b.first) return a.first > b.first; return a.second < b.second; } 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 >> status[i][j]; } for (int j = 1; j <= t; j++) { for (int i = 1; i <= n; i++) task_score[j] += (status[i][j] == 0); } for (int i = 1; i <= n; i++) { contestant[i].first = 0; contestant[i].second = i; for (int j = 1; j <= t; j++) { if (status[i][j]) contestant[i].first += task_score[j]; } } sort(contestant + 1, contestant + n + 1, cmp); for (int i = 1; i <= n; i++) { if (contestant[i].second == p) { cout << contestant[i].first << ' ' << contestant[i].second << '\n'; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...