Submission #312223

#TimeUsernameProblemLanguageResultExecution timeMemory
312223joseacazPoi (IOI09_poi)C++17
100 / 100
1074 ms24056 KiB
#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 timeMemoryGrader output
Fetching results...