# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
221798 | patrikpavic2 | Poi (IOI09_poi) | C++17 | 417 ms | 31864 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.
/**
* user: ppavic
* fname: Patrik
* lname: Pavić
* task: poi
* score: 100.0
* date: 2019-05-11 07:47:44.386747
*/
#include <cstdio>
#include <vector>
#include <algorithm>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef pair < int, int > pii;
typedef pair < int , pii > pip;
const int N = 3050;
int n, t, p, sc[N], A[N][N];
vector < pip > v;
int main(){
scanf("%d%d%d", &n, &t, &p);
for(int i = 0;i < n;i++){
for(int j = 0;j < t;j++){
scanf("%d", &A[i][j]);
sc[j] += !A[i][j];
}
}
for(int i = 0;i < n;i++){
int cur = 0, cnt = 0;
for(int j = 0;j < t;j++)
cur += A[i][j] * sc[j], cnt += A[i][j];
v.PB({-cur, {-cnt, i + 1}});
if(i + 1 == p) printf("%d ", cur);
}
sort(v.begin(), v.end());
for(int i = 0;i < n;i++){
if(v[i].Y.Y == p)
printf("%d\n", i + 1);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |