| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 632241 | device | Poi (IOI09_poi) | C++17 | 617 ms | 18820 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
bool cmp(pair<int,pair<int,int>> a, pair<int,pair<int,int>> b){
	if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
	else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
	else return a.ff < b.ff;
}
int main(){
	int n,t,p; cin >> n >> t >> p;
	pair<int,int> par[n+1];
	vector<int> psolved[t+1];
	int tsolved[t+1] = {};
	for(int i = 1; i <= n; i++) par[i] = {0,0};
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= t; j++){
			int cmd; cin >> cmd;
			if(cmd){
				psolved[j].pb(i);
				tsolved[j]++;
				par[i].ss++;
			}
		}
	}
	for(int i = 1; i <= t; i++){
		for(int nxt:psolved[i]){
			par[nxt].ff += n-tsolved[i];
		}
	}
	vector<pair<int,pair<int,int>>> v;
	for(int i = 1; i <= n; i++){
		v.pb({i,par[i]});
	}
	sort(v.begin(),v.end(),cmp);
	for(int i = 0; i < n; i++){
		if(v[i].ff == p) cout << v[i].ss.ff << " " << i+1 << "\n";
	}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
