Submission #650745

# Submission time Handle Problem Language Result Execution time Memory
650745 2022-10-15T04:38:15 Z muazhussain Poi (IOI09_poi) C++17
0 / 100
217 ms 16204 KB
#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
1 Incorrect 1 ms 212 KB Output isn't correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 1 ms 444 KB Output isn't correct
6 Incorrect 1 ms 212 KB Output isn't correct
7 Incorrect 1 ms 340 KB Output isn't correct
8 Incorrect 1 ms 340 KB Output isn't correct
9 Incorrect 2 ms 340 KB Output isn't correct
10 Incorrect 2 ms 468 KB Output isn't correct
11 Incorrect 7 ms 980 KB Output isn't correct
12 Incorrect 12 ms 1296 KB Output isn't correct
13 Incorrect 33 ms 2896 KB Output isn't correct
14 Incorrect 45 ms 3888 KB Output isn't correct
15 Incorrect 78 ms 6364 KB Output isn't correct
16 Incorrect 86 ms 6868 KB Output isn't correct
17 Incorrect 123 ms 9976 KB Output isn't correct
18 Incorrect 140 ms 11160 KB Output isn't correct
19 Incorrect 188 ms 14732 KB Output isn't correct
20 Incorrect 217 ms 16204 KB Output isn't correct