# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
885062 | Matjaz | Poi (IOI09_poi) | C++14 | 492 ms | 23876 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.
//
// POIIOI2009.cpp
//
//
// Created by Matjaz Leonardis on 09/12/2023.
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N,T,P;
int main(){
cin >> N >> T >> P;
vector<vector<int> > raw_score(N, vector<int> (T));
vector<int> weight(T);
vector<int> tasks_solved(N);
for (int i=0;i<N;i++){
for (int j=0;j<T;j++) {
cin >> raw_score[i][j];
if (raw_score[i][j] == 0) weight[j]++; else tasks_solved[i]++;
}
}
vector<int> final_score(N);
for (int i=0;i<N;i++){
for (int j=0;j<T;j++) if (raw_score[i][j]) final_score[i] += weight[j];
}
vector<pair<pair<int,int>, int> > rank;
for (int i=0;i<N;i++){
rank.push_back(make_pair(make_pair(final_score[i], tasks_solved[i]), -i));
}
sort(rank.rbegin(), rank.rend());
for (int i=0;i<N;i++){
if (rank[i].second == - P + 1){
cout << rank[i].first.first << " " << i + 1 << endl;
break;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |