제출 #757896

#제출 시각아이디문제언어결과실행 시간메모리
757896SanguineChameleonPoi (IOI09_poi)C++17
100 / 100
225 ms24040 KiB
#include <bits/stdc++.h> using namespace std; void just_do_it(); int main() { #ifdef KAMIRULEZ freopen("kamirulez.inp", "r", stdin); freopen("kamirulez.out", "w", stdout); #endif ios_base::sync_with_stdio(0); cin.tie(0); just_do_it(); return 0; } const int maxn = 2e3 + 20; int a[maxn][maxn]; int cnt[maxn]; int score[maxn]; int solve[maxn]; int order[maxn]; int pos[maxn]; bool cmp(int x, int y) { if (score[x] != score[y]) { return score[x] > score[y]; } else if (solve[x] != solve[y]) { return solve[x] > solve[y]; } else { return x < y; } } void just_do_it() { int n, m, k; cin >> n >> m >> k; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> a[i][j]; if (a[i][j] == 0) { cnt[j]++; } else { solve[i]++; } } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (a[i][j]) { score[i] += cnt[j]; } } } for (int i = 1; i <= n; i++) { order[i] = i; } sort(order + 1, order + n + 1, cmp); for (int i = 1; i <= n; i++) { pos[order[i]] = i; } cout << score[k] << " " << pos[k]; }
#Verdict Execution timeMemoryGrader output
Fetching results...