# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1020084 | AliHasanli | Poi (IOI09_poi) | C++17 | 363 ms | 11860 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;
int main()
{
int n,t,P;
cin>>n>>t>>P;
int cnt[t];
bool a[n][t];
for(int i=0;i<t;i++)cnt[i]=0;
pair<int,pair<int,int>>p[n];
for(int i=0;i<n;i++)
{
p[i].second.second=-i-1;
p[i].second.first=0;
p[i].first=0;
for(int j=0;j<t;j++)
{
cin>>a[i][j];
if(!a[i][j])cnt[j]++;
else p[i].second.first++;
}
}
for(int i=0;i<n;i++)
for(int j=0;j<t;j++)
p[i].first+=cnt[j]*a[i][j];
sort(p,p+n);
for(int i=n-1;i>=0;i--)
if(p[i].second.second==-P)
cout<<p[i].first<<" "<<n-i;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |