# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
754139 |
2023-06-07T01:53:59 Z |
vjudge1 |
Poi (IOI09_poi) |
C++17 |
|
282 ms |
19612 KB |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
bool comparator(pair<int, pair<int, int>> &a, pair<int, pair<int, int>> &b) {
if(a.se.se != b.se.se) return a.se.se > b.se.se;
if(a.se.fi != b.se.se) return a.se.fi > b.se.fi;
else return a.fi < b.fi;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, t, p;
cin >> n >> t >> p;
// input & data nilai 0 (nilai tambah)
int nilai[n][t], skortempo[t];
memset(skortempo, 0, sizeof(skortempo));
for(int i=0; i<n; i++) {
for(int j=0; j<t; j++) {
cin >> nilai[i][j];
if(nilai[i][j] == 0) skortempo[j]++;
}
}
pair <int, pair <int, int>> data[n]; // id, (solved task count, nilai total)
for(int i=0; i<n; i++) {
data[i].fi = i+1;
data[i].se.fi = 0;
data[i].se.se = 0;
for(int j=0; j<t; j++) {
if(nilai[i][j] != 0) {
data[i].se.se += skortempo[j];
data[i].se.fi++;
}
}
}
sort(data, data+n, comparator);
for(int i=0; i<n; i++) {
if(data[i].fi == p) {
cout << data[i].se.se << " " << i+1;
break;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
2 ms |
404 KB |
Output is correct |
10 |
Correct |
2 ms |
468 KB |
Output is correct |
11 |
Correct |
7 ms |
980 KB |
Output is correct |
12 |
Incorrect |
13 ms |
1476 KB |
Output isn't correct |
13 |
Correct |
34 ms |
3776 KB |
Output is correct |
14 |
Correct |
48 ms |
5196 KB |
Output is correct |
15 |
Correct |
92 ms |
9112 KB |
Output is correct |
16 |
Correct |
92 ms |
9796 KB |
Output is correct |
17 |
Incorrect |
137 ms |
13324 KB |
Output isn't correct |
18 |
Correct |
158 ms |
14552 KB |
Output is correct |
19 |
Incorrect |
209 ms |
18076 KB |
Output isn't correct |
20 |
Correct |
282 ms |
19612 KB |
Output is correct |