# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480173 | gg123_pe | Poi (IOI09_poi) | C++14 | 687 ms | 15972 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;
#define f(i,a,b) for(int i = a; i < b; i++)
int n, t, p, grade[2005], a[2005][2005];
vector <pair<int,pair<int,int>>> v;
int main(){
cin >> n >> t >> p;
f(i,1,n+1) f(j,1,t+1) cin >> a[i][j];
f(i,1,t+1){
f(j,1,n+1) grade[i] += (a[j][i] == 0);
}
f(i,1,n+1){
int score = 0, c = 0;
f(j,1,t+1) score += a[i][j]*grade[j], c += a[i][j];
v.push_back({-score, {-c, i}});
}
sort(v.begin(), v.end());
f(i,0,n){
if(v[i].second.second == p){
cout << abs(v[i].first) << " " << i+1 << endl;
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |