# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
788394 | canadavid1 | Poi (IOI09_poi) | C++14 | 205 ms | 8752 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;
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |