# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931471 | emad234 | Poi (IOI09_poi) | C++17 | 442 ms | 19308 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>
#define ll long long
#define F first
#define S second
#define pii pair<int,int>
const int mod = 1e9 + 7;
const int mxN = 2e5 + 5;
using namespace std;
struct ranking{
int score,num,id;
};
ranking ans[mxN];
bool operator<(ranking a,ranking b){
return tie(a.score,a.num,a.id) > tie(b.score,b.num,b.id);
}
bool operator==(ranking a,ranking b){
return tie(a.score,a.num,a.id) == tie(b.score,b.num,b.id);
}
int p[mxN];
int a[2021][2021];
signed main(){
int n,t,P;
cin >>n>>t>>P;
for(int i = 1;i <= n;i++){
for(int j = 1;j <= t;j++){
cin >>a[i][j];
if(!a[i][j]) p[j]++;
}
}
for(int i = 1;i <= n;i++){
ans[i].id = {-i};
for(int j = 1;j <= t;j++){
ans[i].num += (a[i][j]);
ans[i].score += (p[j] * a[i][j]);
}
}
sort(ans + 1,ans + n + 1);
for(int i = 1;i <= n;i++){
if(ans[i].id == -P){
cout<<ans[i].score<<' '<<i;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |