# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
1194146 | | SulA | Poi (IOI09_poi) | C++20 | | 158 ms | 16292 KiB |
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define popcount(x) __builtin_popcountll(x)
using namespace std;
using namespace chrono;
int score[2000], tasks[2000];
void solve() {
int n,t,p; cin >> n >> t >> p;
int a[n][t];
for (int i = 0; i < n; i++) for (int j = 0; j < t; cin >> a[i][j++]);
for (int task = 0; task < t; task++) {
long long get = 0;
for (int i = 0; i < n; i++)
get += a[i][task] == 0;
for (int i = 0; i < n; i++)
score[i] += get * a[i][task],
tasks[i] += a[i][task];
}
int ind[n];
iota(ind, ind + n, 0);
sort(ind, ind + n, [&](int i, int j) {
return make_tuple(score[i], tasks[i], i) < make_tuple(score[j], tasks[j], j);
});
cout << score[p-1] << " " << find(ind, ind + n, p-1) - ind + 1;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// int t; cin >> t; while (t--) {
solve();
// }
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |