Submission #788394

#TimeUsernameProblemLanguageResultExecution timeMemory
788394canadavid1Poi (IOI09_poi)C++14
100 / 100
205 ms8752 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) begin(x),end(x) signed main() { cin.tie(nullptr)->sync_with_stdio(false); int N,T,P; cin >> N >> T >> P; vector<vector<bool>> s(N,vector<bool>(T,false)); for(auto && i : s) for(int j = 0; j < T; j++) {int a; cin >> a; i[j] = a;} vector<int> solveNum(T,0); for(auto && i : s) for(int j = 0; j < T; j++) if(!i[j]) solveNum[j]++; vector<tuple<int,int,int>> scores(N,{0,0,0}); for(int i = 0; i < N; i++) { for(int j = 0; j < T; j++) if (s[i][j]) {get<0>(scores[i])-=solveNum[j];get<1>(scores[i])--;} get<2>(scores[i]) = i+1; // person id } sort(all(scores)); // find P int i; for(i = 0; get<2>(scores[i])!=P;i++); cout << -get<0>(scores[i]) << " " << i+1 << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...