# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
602229 | chinmoy_101 | Poi (IOI09_poi) | C++14 | 636 ms | 7312 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 ll long long int
bool cmp(pair<int, int>a, pair<int, int> b)
{
if(a.second>b.second)
return 1;
else
return 0;
}
int main()
{
int n, t, p;
cin>>n >>t >>p;
p--;
int arr[5][3]; //RXC
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin>>arr[i][j];
}
}
int points[t];
int cnt=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
if(arr[j][i]==0)
{
cnt++;
}
}
points[i]=cnt;
cnt=0;
}
vector<pair<int, int>> v(n, {0, 0});
int ans=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
if(arr[i][j]==1)
{
ans+=points[j];
}
}
v[i]={i, ans};
ans=0;
}
sort(v.begin(), v.end(), cmp);
cout<<v[p].second <<" " <<v[p].first+1;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |