# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
921527 |
2024-02-04T05:41:23 Z |
josanneo22 |
Poi (IOI09_poi) |
C++17 |
|
172 ms |
16216 KB |
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define L(i,j,k) for(int i=(j);i<=(k);++i)
#define R(i,j,k) for(int i=(j);i>=(k);--i)
#define all(x) x.begin(),x.end()
#define me(x,a) memset(x,a,sizeof(x))
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int N, M; int id; cin >> N >> M >> id;
vector<i64> people_not_scoring(M + 1, N);
vector<vector<int>> a(N + 1, vector<int>(M + 1));
L(i, 1, N) {
L(j, 1, M) {
cin >> a[i][j];
people_not_scoring[j] -= (a[i][j] == 1);
}
}
vector<i64> score(N + 1);
L(i, 1, N) L(j, 1, M) score[i] += 1LL * a[i][j] * people_not_scoring[j];
vector<int> ord(N); iota(all(ord), 1);
sort(all(ord), [&](int i, int j) {
if (score[i] == score[j]) return i < j;
return score[i] > score[j];
});
L(i, 0, N - 1) {
if (ord[i] == id) {
cout << score[id] << ' ' << i + 1 << '\n';
return 0;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
6 ms |
860 KB |
Output is correct |
12 |
Correct |
9 ms |
1116 KB |
Output is correct |
13 |
Incorrect |
26 ms |
2648 KB |
Output isn't correct |
14 |
Correct |
37 ms |
3676 KB |
Output is correct |
15 |
Incorrect |
76 ms |
6232 KB |
Output isn't correct |
16 |
Correct |
70 ms |
6748 KB |
Output is correct |
17 |
Correct |
105 ms |
9816 KB |
Output is correct |
18 |
Correct |
120 ms |
11168 KB |
Output is correct |
19 |
Correct |
161 ms |
14628 KB |
Output is correct |
20 |
Correct |
172 ms |
16216 KB |
Output is correct |