| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 757896 | SanguineChameleon | Poi (IOI09_poi) | C++17 | 225 ms | 24040 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
