제출 #440178

#제출 시각아이디문제언어결과실행 시간메모리
440178dxz05Poi (IOI09_poi)C++14
0 / 100
888 ms8496 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 2022; bool sol[MAXN][MAXN]; int cnt[MAXN]; pair<pair<int, int>, int> a[MAXN]; int points[MAXN], solved[MAXN]; int main(){ int N, M, P; cin >> N >> M >> P; fill(cnt, cnt + M, N); for (int i = 0; i < N; i++){ for (int j = 0; j < M; j++){ cin >> sol[i][j]; cnt[j] -= sol[i][j]; } } vector<int> v(N); for (int i = 0; i < N; i++){ v[i] = i; for (int j = 0; j < M; j++){ if (sol[i][j]){ points[i] += cnt[j]; solved[i]++; } } } sort(v.begin(), v.end(), [](int i, int j){ if (points[i] > points[j]) return true; if (solved[i] > solved[j]) return true; return i < j; }); for (int i = 0; i < N; i++){ int j = v[i]; if (j + 1 == P){ cout << points[j] << ' ' << j + 1 << endl; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...