# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569401 | Aurora2005 | Poi (IOI09_poi) | C++14 | 603 ms | 23812 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;
int main(){
int N,T,P;
cin >> N >> T >> P;
vector<vector<int>> solve(N,vector<int>(T));
for(int i=0;i<N;i++) for(int j=0;j<T;j++) cin >> solve[i][j];
vector<int> Wcnt(T,0);
for(int i=0;i<N;i++) for(int j=0;j<T;j++) Wcnt[j] += 1-solve[i][j];
vector<int> Score(N,0),cnt(N,0);
for(int i=0;i<N;i++){
for(int j=0;j<T;j++){
if(solve[i][j] == 1){
Score[i] += Wcnt[j];
cnt[i]++;
}
}
}
vector<pair<pair<int,int>,int>> Rank(N);
for(int i=0;i<N;i++) Rank[i] = make_pair(make_pair(-Score[i],-cnt[i]),i+1);
sort(Rank.begin(),Rank.end());
int ans;
for(int i=0;i<N;i++) if(Rank[i].second == P) ans = i+1;
cout << Score[P-1] << " " << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |