| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 671948 | sudheerays123 | Poi (IOI09_poi) | C++17 | 224 ms | 39672 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
const ll N = 100+5 , INF = 1e18 , MOD = 1e9+7;
bool comp(tuple<ll,ll,ll> a , tuple<ll,ll,ll> b){
	ll x1,y1,z1,x2,y2,z2;
	tie(x1,y1,z1) = a;
	tie(x2,y2,z2) = b;
	if(x1 != x2) return x1 > x2;
	if(y1 != y2) return y1 > y2;
	return z1 < z2;
}
void solve(){
	ll n,t,p;
	cin >> n >> t >> p;
	vector<vector<ll>> task(n+5,vector<ll>(t+5));
	vector<ll> solved(n+5,0),score(n+5),point(t+5,n);
	for(ll i = 1; i <= n; i++){
		for(ll j = 1; j <= t; j++){
			cin >> task[i][j];
			if(task[i][j]){
				solved[i]++;
				point[j]--;
			}
		}
	}
	for(ll i = 1; i <= n; i++){
		for(ll j = 1; j <= t; j++){
			if(task[i][j]) score[i] += point[j];
		}
	}
	vector<tuple<ll,ll,ll>> rank;
	for(ll i = 1; i <= n; i++) rank.push_back(make_tuple(score[i],solved[i],i));
	sort(rank.begin(),rank.end(),comp);
	for(ll i = 0; i < n; i++){
		if(get<2>(rank[i]) == p){
			cout << get<0>(rank[i]) << " " << i+1;
			return;
		}
	}
	
}
int main(){
	fast;
	ll tc = 1;
	// cin >> tc;
	while(tc--) solve();
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
