제출 #393979

#제출 시각아이디문제언어결과실행 시간메모리
393979BertedPoi (IOI09_poi)C++14
100 / 100
276 ms23812 KiB
#include <iostream> using namespace std; int N, M, K, B[2001][2001], cnt[2001], A[2001][2]; int main() { ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N >> M >> K; K--; for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { cin >> B[i][j]; cnt[j] += !B[i][j]; } } for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) {A[i][0] += B[i][j] * cnt[j]; A[i][1] += B[i][j];} } int ans = 1; for (int i = 0; i < N; i++) { if (i == K) continue; ans += make_pair(A[i][0], make_pair(A[i][1], -i)) > make_pair(A[K][0], make_pair(A[K][1], -K)); } cout << A[K][0] << " " << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...