| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 657245 | happypotato | Poi (IOI09_poi) | C++17 | 596 ms | 15956 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n, t, p;
	cin >> n >> t >> p;
	int a[n + 1][t];
	int score[n + 1], solves[n + 1];
	for (int i = 1; i <= n; i++) {
		score[i] = 0;
		solves[i] = 0;
		for (int j = 0; j < t; j++) {
			cin >> a[i][j];
			solves[i] += a[i][j];
		}
	}
	for (int i = 0; i < t; i++) {
		int mark = 0;
		for (int j = 1; j <= n; j++) {
			mark += (a[j][i] == 0);
		}
		for (int j = 1; j <= n; j++) {
			if (a[j][i]) score[j] += mark;
		}
	}
	int rank = 1;
	for (int i = 1; i <= n; i++) {
		if (i == p) continue;
		if (score[i] > score[p]) rank++;
		else if (score[i] == score[p]) {
			if (solves[i] > solves[p]) rank++;
			else if (solves[i] == solves[p]) {
				if (i < p) rank++;
			}
		}
	}
	cout << score[p] << ' ' << rank << endl;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
