# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
259521 | c4ts0up | Poi (IOI09_poi) | C++17 | 889 ms | 17560 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.
/*
ID: c4ts0up
LANG: C++
TASK:
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
const int NMAX = 2005;
int n, t, p;
vector <int> tasks, scores;
vector <int> done[NMAX];
int main() {
/*//
freopen("", "r", stdin);
freopen("", "w", stdout);
//*/
cin >> n >> t >> p;
scores.resize(n+1);
tasks.resize(t);
for (int i=1; i<=n; i++) {
for (int j=0; j<t; j++) {
int aux;
cin >> aux;
tasks[j] += aux;
if (aux) done[i].pb(j);
}
}
for (int i=1; i<=n; i++) {
for (int x : done[i]) scores[i] += n-tasks[x];
}
int philscore = scores[p];
int philsolved = done[p].size();
int above = 0;
for (int i=1; i<=n; i++) {
if (scores[i] > philscore) above++;
else if (scores[i] < philscore) continue;
// mismo puntaje
else {
if (done[i].size() > philsolved) above++;
else if (done[i].size() < philsolved) continue;
// mismo numero de tareas resueltas
else {
if (i < p) above++;
else continue;
}
}
}
cout << philscore << " " << above+1 << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |