| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 931462 | emad234 | Poi (IOI09_poi) | C++17 | 394 ms | 36316 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pii pair<int,int>
const int mod = 1e9 + 7;
const int mxN = 2e5 + 5;
using namespace std;
struct ranking{
	int score,num,id;
};
ranking ans[mxN];
bool operator<(ranking a,ranking b){
	return tie(a.score,a.num,a.id) < tie(b.score,b.num,b.id);
}
int p[mxN];
int a[1001][1001];
signed main(){
	int n,t,P;
	cin >>n>>t>>P;
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= t;j++){
			cin >>a[i][j];
			if(!a[i][j]) p[j]++;
		}
	}
	for(int i = 1;i <= n;i++){
		ans[i].id = {i};
		for(int j = 1;j <= t;j++){
			ans[i].num += (a[i][j]);
			ans[i].score += (p[j] * a[i][j]);
		}
	}
	sort(ans + 1,ans + n + 1);
	for(int i = 1;i <= n;i++){
		if(ans[i].id == P){
			cout<<ans[i].score<<' '<<i;
			return 0;
		}
	}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
