| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 650745 | muazhussain | Poi (IOI09_poi) | C++17 | 217 ms | 16204 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool func(const pair<pair<int,int>,int>p1, const pair<pair<int,int>,int> p2){
    if(p1.first.second!=p2.first.second){
        return p1.first.second<p2.first.second;
    }else if(p1.second!=p2.second){
        return p1.second<p2.second;
    }
    return p1.first.first<p2.first.first;
}
void solve(){
    int N,T,P;
    cin>>N>>T>>P;
    int ar[N][T];
    vector<int>mark(T,N);
    vector<int>task(N);
    for(int i=0;i<N;i++){
        for(int j=0;j<T;j++){
            cin>>ar[i][j];
            if(ar[i][j]){
                mark[j]--;
                task[i]++;
            }
        }
    }
    vector<pair<pair<int,int>,int>>res;
    for(int i=1;i<=N;i++){
        int score=0;
        for(int j=0;j<T;j++){
            score+=(ar[i-1][j]*mark[j]);
        }
        res.push_back({{i,score},task[i-1]});
    }
    // for(auto e:res){
    //     cout<<"id: "<<e.first.first<<" score: "<<e.first.second<<" task: "<<e.second<<endl;
    // }
    sort(res.begin(), res.end(),func);
    // for(auto e:res){
    //     cout<<"id: "<<e.first.first<<" score: "<<e.first.second<<" task: "<<e.second<<endl;
    // }
    int cnt=1;
    for(auto e:res){
        if(e.first.first==P){
            cout<<e.first.second<<" "<<cnt<<"\n";
            return;
        }
        cnt++;
    }
}
int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int T=1;
    // cin>>T;
    while(T--){
        solve();
    }
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
