# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1113490 | Zflop | Poi (IOI09_poi) | C++14 | 402 ms | 24040 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;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
int N,M,P,A[2001][2001],scor_problema[2001];
void solve() {
cin >> N >> M >> P;
for (int i = 1; i <= N;++i) {
for (int j = 1; j <= M;++j)
cin >> A[i][j];
}
for (int j = 1; j <= M;++j)
for (int i = 1; i <= N;++i)
scor_problema[j] += !A[i][j];
vector<vector<int>>jucatori;
for (int i = 1; i <= N;++i) {
int scor = 0,tasks = 0;
for (int j = 1; j <= M;++j) {
if (A[i][j]) {
++tasks;
scor += scor_problema[j];
}
}
jucatori.push_back({scor,tasks,i});
}
sort(jucatori.begin(),jucatori.end(),[&](vector<int>a,vector<int>b) {
if (a[0] != b[0]) return a[0] > b[0];
if (a[1] != b[1]) return a[1] > b[1];
return a[2] < b[2];
});
for (int i = 0; i < N;++i)
if (jucatori[i][2] == P)
cout << jucatori[i][0] << ' ' << i + 1 << '\n';
}
int main() {
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |