| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 978957 | tamir1 | Poi (IOI09_poi) | C++17 | 220 ms | 12148 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct ct{
	ll pt,sd,id;
};
ct x[2005];
ll n,t,me,i,j,p[2005];
bool a[2005][2005];
bool cmp(ct a,ct b){
	if(a.pt==b.pt && a.sd==b.sd) return a.id<b.id;
	if(a.pt==b.pt) return a.sd>b.sd;
	return a.pt>b.pt;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> n >> t >> me;
	for(i=1;i<=n;i++)
	for(j=1;j<=t;j++){
		cin >> a[i][j];
		if(!a[i][j]) p[j]++;
	}
	for(i=1;i<=n;i++){
		x[i].id=i;
		for(j=1;j<=t;j++){
			if(a[i][j]){
				x[i].sd++;
				x[i].pt+=p[j];
			}
		}
	}
	sort(x+1,x+n+1,cmp);
	for(i=1;i<=n;i++){
		if(x[i].id==me){
			cout << x[i].pt << " " << i;
			return 0;
		}
	}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
