| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 304408 | dolijan | Poi (IOI09_poi) | C++14 | 1143 ms | 4472 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct skor{
    public:
    int poeni,br,rb;
};
bool comp(skor a,skor b)
{
    if(a.poeni>b.poeni) return true;
    else if(a.poeni==b.poeni)
    {
        if(a.br>b.br) return true;
        else if(a.br==b.br)
        {
            if(a.rb<b.rb) return true;
        }
    }
    return false;
}
int main()
{
    int n,t,p;
    cin>>n>>t>>p;
    int resen[t];
    for(int i=0;i<t;i++) resen[i]=0;
    bool li[n][t];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<t;j++)
        {
            cin>>li[i][j];
            resen[j]+=li[i][j];
        }
    }
    skor takm[n];
    skor pom;
    for(int i=0;i<n;i++)
    {
        pom.poeni=0;
        pom.br=0;
        pom.rb=i;
        for(int j=0;j<t;j++)
        {
            if(li[i][j])
            {
                pom.poeni+=(n-resen[j]);
                pom.br++;
            }
        }
        takm[i]=pom;
    }
    sort(takm,takm+n,comp);
    for(int i=0;i<n;i++)
    {
        if(takm[i].rb==p-1)
        {
            cout<<takm[i].poeni<<" "<<i+1<<endl;
        }
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
