| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 349589 | Farrius | Poi (IOI09_poi) | C++11 | 676 ms | 23916 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MX = 2e3 + 5;
int points[MX], pp[MX];
bool cmp (const pair<int, pair<int, int>>& a, const pair<int, pair<int, int>>& b) {
	if (a.first == b.first) {
		if (a.second.first == b.second.first) return a.second.second < b.second.second;
		else return a.second.first > b.second.first;
	} else {
		return a.first > b.first;
	}
}
int main () {
	int n, t, p;
	cin >> n >> t >> p;
	vector<pair<int, pair<int, int>>> score;
	vector<vector<int>> ar(n, vector<int>(t));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < t; j++) {
			cin >> ar[i][j];
			if (ar[i][j] == 1) points[j]++;
		}
	}
	for (int i = 0; i < n; i++) {
		int cur = 0, prob = 0;
		for (int j = 0; j < t; j++) {
			if (ar[i][j] == 1) {
				prob++;
				cur += n - points[j];
			}
		}
		score.push_back(make_pair(cur, make_pair(prob, i)));
	}
	sort(score.begin(), score.end(), cmp);
	p--;
	for (int i = 0; i < n; i++) {
		if (score[i].second.second == p) {
			cout << score[i].first << ' ' <<  i + 1 << '\n';
			break;
		}
	}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
