# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
366747 | kostia244 | Poi (IOI09_poi) | C++17 | 279 ms | 24044 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.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(x) begin(x), end(x)
const int maxn = 2020;
int n, m, p, score[maxn], val[maxn], cnt[maxn], a[maxn][maxn];
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m >> p;
for(int i = 0; i < n; i++)
for(int j = 0; j < m; j++) {
cin >> a[i][j],
val[j] += !a[i][j],
cnt[i] += a[i][j];
}
for(int i = 0; i < n; i++)
for(int j = 0; j < m; j++)
score[i] += val[j]*a[i][j];
vector<array<int, 3>> f(n);
for(int i = 0; i < n; i++) f[i] = {-score[i], -cnt[i], i};
sort(all(f));
int ans = 0;--p;
while(f[ans][2] != p) ans++;
cout << -f[ans][0] << " " << ans+1 << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |