# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
239445 | Autoratch | Poi (IOI09_poi) | C++14 | 311 ms | 16120 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;
const int N = 2001;
int n,t,p;
int a[N][N],no[N],sc[N],ta[N];
vector<pair<int,pair<int,int> > > res;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> t >> p;
for(int i = 1;i <= n;i++) for(int j = 1;j <= t;j++) cin >> a[i][j];
for(int i = 1;i <= n;i++) for(int j = 1;j <= t;j++) if(!a[i][j]) no[j]++;
for(int i = 1;i <= n;i++) for(int j = 1;j <= t;j++) if(a[i][j]) sc[i]+=no[j],ta[i]++;
for(int i = 1;i <= n;i++) res.push_back({-sc[i],{-ta[i],i}});
sort(res.begin(),res.end());
int id = 1;
for(auto it : res)
{
if(it.second.second==p){ cout << -it.first << ' ' << id; return 0; }
id++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |