# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
423757 |
2021-06-11T12:23:35 Z |
haxorman |
Poi (IOI09_poi) |
C++14 |
|
323 ms |
15956 KB |
#include <bits/stdc++.h>
using namespace std;
const int mxN = 2007;
int tasks[mxN], solved[mxN][mxN];
pair<int,pair<int,int>> points[mxN];
int32_t main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.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])
tasks[j]++;
}
}
for (int i = 1; i <= n; ++i) {
int cur = 0, cnt = 0;
for (int j = 1; j <= n; ++j) {
if (solved[i][j]) {
cnt++;
cur += tasks[j];
}
}
points[i] = {cur, {cnt, i}};
}
sort(points + 1, points + n + 1, greater<pair<int,pair<int,int>>>());
bool ok = false;
while (!ok) {
ok = true;
for (int i = 2; i <= n; ++i) {
if (points[i].first == points[i - 1].first &&
points[i].second.first == points[i - 1].second.first &&
points[i].second.second < points[i - 1].second.second) {
swap(points[i], points[i - 1]);
ok = false;
break;
}
}
}
for (int i = 1; i <= n; ++i) {
if (points[i].second.second == p) {
cout << points[i].first << ' ' << i << "\n";
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
6 |
Correct |
1 ms |
460 KB |
Output is correct |
7 |
Incorrect |
1 ms |
588 KB |
Output isn't correct |
8 |
Correct |
1 ms |
588 KB |
Output is correct |
9 |
Incorrect |
2 ms |
716 KB |
Output isn't correct |
10 |
Correct |
3 ms |
1228 KB |
Output is correct |
11 |
Incorrect |
10 ms |
1996 KB |
Output isn't correct |
12 |
Correct |
19 ms |
3104 KB |
Output is correct |
13 |
Incorrect |
54 ms |
5476 KB |
Output isn't correct |
14 |
Correct |
72 ms |
7540 KB |
Output is correct |
15 |
Incorrect |
127 ms |
9648 KB |
Output isn't correct |
16 |
Correct |
140 ms |
10544 KB |
Output is correct |
17 |
Incorrect |
194 ms |
12172 KB |
Output isn't correct |
18 |
Correct |
227 ms |
13672 KB |
Output is correct |
19 |
Correct |
293 ms |
15956 KB |
Output is correct |
20 |
Correct |
323 ms |
15940 KB |
Output is correct |