| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 797046 | pluto_ish | Poi (IOI09_poi) | C++14 | 497 ms | 23872 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct d_score{
	int score;
	int num_problems;
	int id;
};
bool cmp(d_score a, d_score b){
	if(a.score == b.score){
		if(a.num_problems == b.num_problems) return a.id < b.id;
		return a.num_problems > b.num_problems;
	}
	return a.score > b.score;
}
int main(){
	int n, t, p;
	cin >> n >> t >> p;
	vector< vector<int> > a(n, vector<int>(t, 0));
	for(vector<int>& x : a){
		for(int& y : x) cin >> y;
	}
	
	vector<int> pts(t, 0);
	for(int i=0;i<t;i++){
		for(int j=0;j<n;j++){
			if(a[j][i] == 0) pts[i]++;
		}
	}
	vector<d_score> scores(n);
	for(int i=0;i<n;i++){
		int np = 0, sc = 0;
		for(int j=0;j<t;j++){
			if(a[i][j]){
				np++;
				sc += pts[j];
			}
		}
		scores[i] = d_score{sc, np, i+1};
	}
	sort(scores.begin(), scores.end(), cmp);
	for(int i=0;i<n;i++){
		if(scores[i].id == p){
			cout << scores[i].score << " " << i+1 << "\n";
			break;
		}
	}
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
