| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 309879 | Temmie | Poi (IOI09_poi) | C++17 | 337 ms | 9752 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
int n, t, p;
struct C {
	int id;
	int point = 0;
	std::vector <int> solve;
	bool operator<(const C& other) const {
		if (point == other.point) {
			if (solve.size() == other.solve.size()) return id < other.id;
			return solve.size() > other.solve.size();
		}
		return point > other.point;
	}
};
std::vector <int> task;
std::vector <C> c;
int main() {
	std::ios::sync_with_stdio(0); std::cin.tie(0);
	
	std::cin >> n >> t >> p;
	task.resize(t, 0);
	c.resize(n);
	for (int i = 0; i < n; i++) {
		c[i].id = i;
		for (int j = 0; j < t; j++) {
			bool now; std::cin >> now;
			task[j] += now;
			if (now) c[i].solve.push_back(j);
		}
	}
	for (int i = 0; i < t; i++) {
		task[i] = n - task[i];
	}
	for (int i = 0; i < n; i++) {
		for (int x : c[i].solve) {
			c[i].point += task[x];
		}
	}
	std::sort(c.begin(), c.end());
	for (int i = 0; i < n; i++) {
		if (c[i].id == p - 1) {
			std::cout << c[i].point << " " << i + 1 << "\n";
			return 0;
		}
	}
	
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
