제출 #931467

#제출 시각아이디문제언어결과실행 시간메모리
931467emad234Poi (IOI09_poi)C++17
70 / 100
430 ms35456 KiB
#include <bits/stdc++.h> #define int 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); } 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 timeMemoryGrader output
Fetching results...