# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
312223 | joseacaz | Poi (IOI09_poi) | C++17 | 1074 ms | 24056 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 <iostream>
#include <algorithm>
#define MAXN 2005
#define MAXT 2005
using namespace std;
typedef long long int lld;
int N, T, P, s[MAXN][MAXT], score[MAXT];
pair < int, pair < int, int > > points[MAXN];
int main ()
{
cin >> N >> T >> P;
for ( int i = 0; i < N; i++ )
{
for ( int task = 0; task < T; task++ )
{
cin >> s[i][task];
score[task] += (s[i][task] ^ 1);
}
}
for ( int i = 0; i < N; i++ )
for ( int j = 0; j < T; j++ )
points[i].first -= (s[i][j] ? score[j] : 0 ), points[i].second.first -= s[i][j], points[i].second.second = i;
sort ( points, points + N );
for ( int i = 0; i < N; i++ )
if ( points[i].second.second == P - 1 )
cout << -points[i].first << " " << i + 1 << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |