# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346485 | MilosMilutinovic | Poi (IOI09_poi) | C++14 | 299 ms | 23916 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/**
* author: milos
* created: 10.01.2021 01:42:54
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, t, id;
cin >> n >> t >> id;
--id;
vector<vector<int>> a(n, vector<int>(t));
vector<int> cnt(t, 0);
for (int i = 0; i < n; i++) {
for (int j = 0; j < t; j++) {
cin >> a[i][j];
cnt[j] += a[i][j];
}
}
vector<int> p(t);
for (int i = 0; i < t; i++) {
p[i] = n - cnt[i];
}
vector<tuple<int, int, int>> b;
for (int i = 0; i < n; i++) {
int sum = 0;
for (int j = 0; j < t; j++) {
if (a[i][j] == 1) {
sum += p[j];
}
}
b.emplace_back(sum, accumulate(a[i].begin(), a[i].end(), 0), n - i);
}
sort(b.rbegin(), b.rend());
for (int i = 0; i < (int) b.size(); i++) {
if (get<2>(b[i]) == n - id) {
cout << get<0>(b[i]) << " " << i + 1 << '\n';
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |