# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931380 | thisisadarsh | Poi (IOI09_poi) | C++14 | 482 ms | 23808 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>> a(N, vector<int> (T,0));
vector<int>score(T,0);
for(int i = 0; i < N; i++){
for(int j = 0; j < T; j++){
cin >> a[i][j];
}
}
for(int i = 0; i < T; i++){
for(int j = 0; j < N; j++){
if(a[j][i] == 0){
score[i]++;
}
}
}
vector<pair<int, int>>player_score(N);
for(int i = 0; i < N; i++){
player_score[i].second = i+1;
}
for(int i = 0; i < N; i++){
for(int j = 0; j < T; j++){
if(a[i][j] != 0){
player_score[i].first += score[j];
}
}
}
sort(player_score.begin(), player_score.end());
for(int i = 0; i < N; i++){
if(player_score[i].second == P){
cout << player_score[i].first << ' ' << i + 1 << '\n';
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |