# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
698125 | europium | Poi (IOI09_poi) | C++17 | 214 ms | 16224 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.
// - 12/2/23
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
#include <iterator>
#include <set>
#include <map>
#include <math.h>
#include <iomanip>
#include <unordered_set>
#include <queue>
#include <climits>
using namespace std;
// clang++ -std=c++17 IOI09_POI.cpp && ./a.out
using ll = long long;
void solve(){
int n, t, p;
cin >> n >> t >> p;
vector<int> score(t);
vector<vector<int>> c (n, vector<int>(t));
for (int i = 0; i < n; i++){
for (int j = 0; j < t; j++){
cin >> c[i][j];
if (c[i][j] == 0) score[j]++;
}
}
vector<tuple<int,int,int>> rank; // score, tasks solved, ID;
for (int i = 0; i < n; i++){
int s = 0, solved = 0;
for (int j = 0; j < t; j++){
if (c[i][j] == 1){
s += score[j];
solved++;
}
}
rank.push_back({s, solved, n - (i + 1)});
// cout << s << ' ' << solved << ' ' << i + 1 << '\n';
}
sort(rank.rbegin(), rank.rend());
int cnt = 0;
for (auto [s, solved, id] : rank){
cnt++;
// cout << s << ' ' << solved << ' ' << id << '\n';
if (id == (n - p)){
cout << s << ' ' << cnt << '\n';
return;
}
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt", "r", stdin);
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |