# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
495536 | PiejanVDC | Poi (IOI09_poi) | C++17 | 554 ms | 8696 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;
signed main() {
int n,t,p; cin>>n>>t>>p;
vector<int>v(t,n);
vector<vector<bool>>l(n,vector<bool>(t));
for(int i = 0 ; i < n ; i++) {
for(int j = 0 ; j < t ; j++) {
int x; cin>>x;
if(x) l[i][j] = 1;
if(l[i][j]) v[j]--;
}
}
vector<pair<int,int>>scores;
for(int i = 0 ; i < n ; i++) {
int score = 0;
for(int j = 0 ; j < t ; j++) {
if(l[i][j]) score += v[j];
}
scores.push_back({score,i});
}
p--;
sort(scores.begin(),scores.end());
for(int i = 0 ; i < n ; i++) {
if(scores[i].second == p) {
cout << scores[i].first << " " << ++i;
return 0;
}
}
assert(0);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |