# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
520187 |
2022-01-28T17:29:12 Z |
tkwiatkowski |
Poi (IOI09_poi) |
C++17 |
|
279 ms |
12036 KB |
/*
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 |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
320 KB |
Output is correct |
6 |
Correct |
1 ms |
324 KB |
Output is correct |
7 |
Correct |
1 ms |
460 KB |
Output is correct |
8 |
Correct |
1 ms |
460 KB |
Output is correct |
9 |
Correct |
1 ms |
460 KB |
Output is correct |
10 |
Correct |
2 ms |
696 KB |
Output is correct |
11 |
Correct |
9 ms |
1108 KB |
Output is correct |
12 |
Correct |
18 ms |
1612 KB |
Output is correct |
13 |
Correct |
39 ms |
2772 KB |
Output is correct |
14 |
Correct |
56 ms |
3932 KB |
Output is correct |
15 |
Correct |
109 ms |
5668 KB |
Output is correct |
16 |
Correct |
107 ms |
5996 KB |
Output is correct |
17 |
Correct |
165 ms |
7860 KB |
Output is correct |
18 |
Correct |
181 ms |
8904 KB |
Output is correct |
19 |
Correct |
232 ms |
11272 KB |
Output is correct |
20 |
Correct |
279 ms |
12036 KB |
Output is correct |