# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
289692 | b00n0rp | Poi (IOI09_poi) | C++17 | 312 ms | 23800 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;
typedef long long ll;
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
#define pb push_back
#define INF 100000000
#define mp make_pair
int main() {
ios::sync_with_stdio(false);
int n,t,p;
cin >> n >> t >> p;
int a[n+1][t+1],td[n+1],tv[t+1],pnt[n+1];
//td - tasks_done, tv - tasks_value, pnt - points
fill(td,td+n+1,0);
fill(tv,tv+t+1,0);
fill(pnt,pnt+n+1,0);
for (int i = 1; i <= n; i++){
for (int j = 1; j <= t; j++){
cin >> a[i][j];
if (a[i][j]){
td[i] ++;
}
else{
tv[j] ++;
}
}
}
for (int i = 1; i <= n; i++){
for (int j = 1; j <= t; j++){
if (a[i][j]){
pnt[i] += tv[j];
}
}
}
int phil = pnt[p],rank = 1,tdp = td[p];
cout << phil << " ";
for (int i = 1; i <= n; i++){
if (i == p) continue;
else if (pnt[i] < phil) continue;
else if (pnt[i] > phil) rank ++;
else{
if (td[i] < tdp) continue;
else if (td[i] > tdp) rank ++;
else{
if (i < p) rank ++;
}
}
}
cout << rank << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |