Submission #520187

#TimeUsernameProblemLanguageResultExecution timeMemory
520187tkwiatkowskiPoi (IOI09_poi)C++17
100 / 100
279 ms12036 KiB
/* Zadanie: POI Autor: Tomasz Kwiatkowski */ #include <bits/stdc++.h> using namespace std; const int MAXN = 2e3 + 7; int score[MAXN]; bool solved[MAXN][MAXN]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); int n, t, p; cin >> n >> t >> p; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= t; ++j) { cin >> solved[i][j]; if (!solved[i][j]) score[j] += 1; } } int p_score = 0, p_solved = 0; for (int j = 1; j <= t; ++j) { p_score += solved[p][j]*score[j]; p_solved += solved[p][j]; } int p_place = 1; for (int i = 1; i <= n; ++i) { int c_score = 0, c_solved = 0; for (int j = 1; j <= t; ++j) { c_score += solved[i][j]*score[j]; c_solved += solved[i][j]; } if ((c_score > p_score) || (c_score == p_score && c_solved > p_solved) || (c_score == p_score && c_solved == p_solved && i < p)) ++p_place; } cout << p_score << ' ' << p_place << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...