# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1119777 | kasdo | Poi (IOI09_poi) | C++14 | 498 ms | 39580 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 int long long
signed main()
{
int n, t, p;
cin>>n>>t>>p;
int a[n + 5][t + 5];
int scores[t + 5];
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin>>a[i][j];
scores[j] += a[i][j];
}
}
for(int i=0; i<t; i++) scores[i] = n - scores[i];
vector<int> v;
for(int i=0; i<n; i++)
{
int cur = 0;
for(int j=0; j<t; j++)
{
if (a[i][j] == 1) cur += scores[j];
}
// cout<<cur<<" "<<i<<endl;
v.push_back(cur);
}
int ans = v[p - 1];
cout<<" ";
sort(v.rbegin(), v.rend());
for(int i=0; i<n; i++)
{
if (v[i] == ans)
{
cout<<ans<<" "<<i + 1<<endl;
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |