Submission #489409

#TimeUsernameProblemLanguageResultExecution timeMemory
489409AlexandruabcdePoi (IOI09_poi)C++14
55 / 100
269 ms23752 KiB
#include <bits/stdc++.h> using namespace std; constexpr int NMAX = 2005; int N, T, P; int mat[NMAX][NMAX]; int value[NMAX]; int main () { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> T >> P; for (int i = 1; i <= N; ++ i ) for (int j = 1; j <= T; ++ j ) cin >> mat[i][j]; for (int j = 1; j <= T; ++ j ) { int val = 0; for (int i = 1; i <= N; ++ i ) val += (1 - mat[i][j]); for (int i = 1; i <= N; ++ i ) value[i] += val * mat[i][j]; } int pos = 0; for (int i = 1; i <= N; ++ i ) if (value[i] > value[P]) ++ pos; cout << value[P] << " " << pos+1 << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...