# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940869 | HappyCapybara | Poi (IOI09_poi) | C++17 | 470 ms | 24176 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<int> st(t, n);
vector<vector<int>> ts(n);
for (int i=0; i<n; i++){
for (int j=0; j<t; j++){
int x;
cin >> x;
ts[i].push_back(x);
if (x) st[j]--;
}
}
vector<pair<int, pair<int,int>>> scores;
for (int i=0; i<n; i++){
int score = 0, tasks = 0;
for (int j=0; j<t; j++){
if (ts[i][j]){
tasks++;
score += st[j];
}
}
scores.push_back({score, {tasks, -i}});
}
sort(scores.begin(), scores.end());
//for (pair<int,pair<int,int>> v : scores) cout << v.first << " " << v.second.first << " " << -v.second.second << "\n";
for (int i=0; i<n; i++){
if (-scores[i].second.second == p-1){
cout << scores[i].first << " " << n-i << "\n";
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |