| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 359455 | lakshith_ | Poi (IOI09_poi) | C++14 | 673 ms | 16108 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct student{
	int id;
	int tasks;
	int score;
};
bool comp(student s1,student s2){
	if(s1.score>s2.score)return true;
	else if(s1.score<s2.score)return false;
	else if(s1.tasks>s2.tasks)return true;
	else if(s1.tasks<s2.tasks)return false;
	else return (s1.id<s2.id);
}
int main(){
	int n,t,p;
	cin >> n >> t >> p;
	p--;
	vector<int> scores(t,n);
	vector<vector<int>> vec;
	for(int i=0;i<n;i++){
		vector<int> v;
		for(int j=0;j<t;j++){
			int a;
			cin >> a;
			if(a==1){
				scores[j]--;
				v.push_back(j);
			}
		}
		vec.push_back(v);
	}
	//for(int x:scores)cout <<  x << "\t";
	//cout << "\n";
	vector<student> students;
	for(int i=0;i<n;i++){
		int score = 0;
		for(int x:vec[i])score += scores[x];
		students.push_back({i,vec[i].size(),score});
		//cout << i << "\t" << vec[i].size() << "\t" << score << "\n";
	}
	sort(students.begin(),students.end(),comp);
	for(int i=0;i<n;i++)
		if(students[i].id==p){
			cout << students[i].score << " " << i+1 << "\n";
		}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
