# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
252021 | ScarletS | Poi (IOI09_poi) | C++17 | 301 ms | 4344 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>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
bool b[2000][2000];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n,t,p,x;
cin>>n>>t>>p;
for (int i=0;i<n;++i)
for (int j=0;j<t;++j)
cin>>b[i][j];
int a[t];
for (int i=0;i<t;++i)
{
a[i]=n;
for (int j=0;j<n;++j)
a[i]-=b[j][i];
}
vector<pair<int,int>> v;
for (int i=0;i<n;++i)
{
x=0;
for (int j=0;j<t;++j)
x+=a[j]*b[i][j];
v.push_back({x,-(i+1)});
}
sort(v.rbegin(), v.rend());
for (int i=0;i<n;++i)
if (v[i].second==-p)
cout<<v[i].first<<" "<<i+1<<"\n";
/**
for (int i=0;i<n;++i)
cout<<i+1<<": "<<-v[i].second<<" with "<<v[i].first<<" points\n";
**/
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |