| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 634760 | PolishFighter | Poi (IOI09_poi) | C++17 | 211 ms | 9544 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
constexpr int MAXN = 2e3 + 10;
int score[MAXN];
int task[MAXN];
vector<int> cont[MAXN];
bool check(int a, int b)
{
	if(score[a] > score[b])
		return true;
	if(score[a] == score[b])
	{
		if(cont[a].size() > cont[b].size())
			return true;
		if(cont[a].size() == cont[b].size())
			return a < b;
		return false;
	}
		
	return false;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);	
	int n, t, p, tmp;
	cin >> n >> t >> p;
	p--;
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < t; j++)
		{
			cin >> tmp;
			if(tmp == 0)
				task[j]++;
			else
				cont[i].push_back(j);
		}
	}
	vector<int> cont_s;
	for(int i = 0; i < n; i++)
	{
		for(size_t j = 0; j < cont[i].size(); j++)
		{
			score[i] += task[cont[i][j]];
		}
		cont_s.push_back(i);
	}
	sort(cont_s.begin(), cont_s.end(), check);
	for(int i = 0; i < n; i++)
	{
		if(cont_s[i] == p)
		{
			cout << score[cont_s[i]] << " " << i+1 << "\n";
			return 0;
		}
	}
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
