# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
252019 | ScarletS | Poi (IOI09_poi) | C++17 | 297 ms | 12080 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;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n,t,p,x;
cin>>n>>t>>p;
bool b[n][t];
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";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |