Submission #1018140

#TimeUsernameProblemLanguageResultExecution timeMemory
1018140FaggiPoi (IOI09_poi)C++11
0 / 100
192 ms8788 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long n, t, p, i, j, tasks, punts; bool a; cin >> n >> t >> p; vector<vector<bool>>v(n,vector<bool>(t)); vector<long long>punt(t,n); vector<pair<long long, pair<long long, long long>>>tabla; for(i=0; i<n; i++) { for(j=0; j<t; j++) { cin >> a; if(a) { punt[j]--; } v[i][j]=a; } } for(i=0; i<n; i++) { punts=0ll; tasks=0ll; for(j=0; j<t; j++) { if(v[i][j]) { tasks++; punts+=punt[j]; } } tabla.push_back({punts,{tasks,i}}); } sort(tabla.begin(),tabla.end()); for(i=0; i<int(tabla.size()); i++) { if(tabla[i].second.second==(p-1ll)) { cout << tabla[i].first << ' ' << (i+1ll) << '\n'; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...