# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
423770 |
2021-06-11T12:32:53 Z |
haxorman |
Poi (IOI09_poi) |
C++14 |
|
351 ms |
16036 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 <= t; ++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 && ok; ++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;
}
}
}
for (int i = 1; i <= n; ++i) {
auto cur = points[i];
cout << cur.first << ' ' << cur.second.first << ' ' << cur.second.second << "\n";
/*
if (points[i].second.second == p) {
cout << points[i].first << ' ' << i << "\n";
break;
}
*/
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
332 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
332 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
588 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
588 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
700 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
1228 KB |
Output isn't correct |
11 |
Incorrect |
11 ms |
1976 KB |
Output isn't correct |
12 |
Incorrect |
18 ms |
3112 KB |
Output isn't correct |
13 |
Incorrect |
50 ms |
5480 KB |
Output isn't correct |
14 |
Incorrect |
76 ms |
7584 KB |
Output isn't correct |
15 |
Incorrect |
125 ms |
9684 KB |
Output isn't correct |
16 |
Incorrect |
135 ms |
10528 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
12096 KB |
Output isn't correct |
18 |
Incorrect |
226 ms |
13648 KB |
Output isn't correct |
19 |
Incorrect |
313 ms |
16004 KB |
Output isn't correct |
20 |
Incorrect |
351 ms |
16036 KB |
Output isn't correct |