| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 597487 | hail | Poi (IOI09_poi) | C++17 | 221 ms | 23912 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
bool sor_tup(tuple<int, int, int> a, tuple<int, int, int> b)
{
    if(get<0>(a)>get<0>(b))
    {
        return true;
    }
    else if(get<0>(a)<get<0>(b))
    {
        return false;
    }
    else
    {
        if(get<1>(a)>get<1>(b)) return true;
        else if(get<1>(a)<get<1>(b)) return false;
        else
        {
            if(get<2>(a)<get<2>(b)) return true;
            else return false;
        }
    }
    return false;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, t, p;
    cin>>n>>t>>p;
    vector<int> t_p(t+1);
    vector<vector<int>> k_solves(n+1, vector<int>(t+1, 0));
    vector<tuple<int, int, int>> final_r(n);
    for(int i=1; i<=n; i++)
    {
        get<2>(final_r[i-1])=i;
        for(int j=1; j<=t; j++)
        {
            cin>>k_solves[i][j];
            if(not k_solves[i][j]) t_p[j]++;
            else get<1>(final_r[i-1])++;
        }
    }
    for(int i=1; i<=n; i++)
    {
        for(int j=1; j<=t; j++)
        {
            if(k_solves[i][j]) get<0>(final_r[i-1])+=t_p[j];
        }
    }
    sort(final_r.begin(), final_r.end(), sor_tup);
    for(int i=1; i<=n; i++)
    {
        if(get<2>(final_r[i-1])==p)
        {
            cout<<get<0>(final_r[i-1])<<" "<<i<<"\n";
        }
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
