# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520187 | tkwiatkowski | Poi (IOI09_poi) | C++17 | 279 ms | 12036 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |