| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 501506 | aryan12 | Poi (IOI09_poi) | C++17 | 254 ms | 39620 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
bool cmp(array<int, 3> a, array<int, 3> b) {
	if(a[0] == b[0]) {
		if(a[1] == b[1]) {
			return a[2] < b[2];
		}
		return a[1] > b[1];
	}
	return a[0] > b[0];
}
void Solve() {
	int n, t, p;
	cin >> n >> t >> p;
	int a[n + 1][t + 1];
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= t; j++) {
			cin >> a[i][j];
		}
	}	
	int points[t + 1];
	for(int j = 1; j <= t; j++) {
		int cnt = 0;
		for(int i = 1; i <= n; i++) {
			cnt += 1 - a[i][j];
		}
		points[j] = cnt;
	}
	vector<array<int, 3> > ranking;
	for(int i = 1; i <= n; i++) {
		int cnt_of_points = 0, cnt_of_solves = 0;
		for(int j = 1; j <= t; j++) {
			if(a[i][j] == 1) {
				cnt_of_solves++;
				cnt_of_points += points[j];
			}
		}
		ranking.push_back({cnt_of_points, cnt_of_solves, i});
	}
	sort(ranking.begin(), ranking.end(), cmp);
	for(int i = 0; i < ranking.size(); i++) {
		if(ranking[i][2] == p) {
			cout << ranking[i][0] << " " << i + 1 << "\n";
			return;
		}
	}
	assert(false);
}
int32_t main() {
	auto begin = std::chrono::high_resolution_clock::now();
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
	//cin >> t;
	while(t--) {
		Solve();
	}
	auto end = std::chrono::high_resolution_clock::now();
    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
    cerr << "Time measured: " << elapsed.count() * 1e-9 << " seconds.\n"; 
	return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
