Submission #598465

#TimeUsernameProblemLanguageResultExecution timeMemory
598465Trisanu_DasPoi (IOI09_poi)C++17
0 / 100
21 ms32284 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, t, p; cin >> n >> t >> p; vector<int> solves(t, 0); vector<vector<int> > v(n, vector(t, int(0))); for(int i = 0;i < n;i++) { for(int j = 0;j < t;j++) { cin >> v[i - 1][j]; solves[j] += v[i - 1][j]; } } vector<array<int,3>> stats(n); vector<int> cnt(n, 0); vector<int> sum(n, 0); for(int i = 0;i < n;i++) { for(int j = 0; j < t;j++) { cnt[i] += v[i][j]; sum[i] += v[i][j] * (n - solves[j]); } stats[i-1]={-sum[i],-cnt[i],i}; } p--; sort(stats.begin(), stats.end()); for(int i = 0;i < n;i++) if(stats[i][2] == p) cout << -stats[i][0] << " " << i+1 << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...