| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 405598 | Jasiekstrz | Poi (IOI09_poi) | C++17 | 331 ms | 16580 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int N=2e3;
struct W
{
	int s,c,id;
	bool operator<(const W &oth)
	{
		if(s==oth.s && c==oth.c)
			return id<oth.id;
		else if(s==oth.s)
			return c>oth.c;
		return s>oth.s;
	}
};
int sc[N+10];
int tab[N+10][N+10];
W w[N+10];
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n,t,p;
	cin>>n>>t>>p;
	for(int i=1;i<=t;i++)
		sc[i]=n;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=t;j++)
		{
			cin>>tab[i][j];
			if(tab[i][j])
				sc[j]--;
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=t;j++)
		{
			w[i].s+=tab[i][j]*sc[j];
			w[i].c+=tab[i][j];
		}
		w[i].id=i;
	}
	sort(w+1,w+n+1);
	for(int i=1;i<=n;i++)
	{
		if(w[i].id==p)
		{
			cout<<w[i].s<<" "<<i<<"\n";
			break;
		}
	}
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
