Submission #650744

# Submission time Handle Problem Language Result Execution time Memory
650744 2022-10-15T04:35:36 Z muazhussain Poi (IOI09_poi) C++17
0 / 100
230 ms 23772 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 320 KB Output isn't correct
5 Incorrect 1 ms 212 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 1 ms 340 KB Output isn't correct
10 Incorrect 2 ms 468 KB Output isn't correct
11 Incorrect 13 ms 968 KB Output isn't correct
12 Incorrect 13 ms 1480 KB Output isn't correct
13 Incorrect 35 ms 3816 KB Output isn't correct
14 Incorrect 46 ms 5324 KB Output isn't correct
15 Incorrect 88 ms 9036 KB Output isn't correct
16 Incorrect 89 ms 9852 KB Output isn't correct
17 Incorrect 136 ms 14400 KB Output isn't correct
18 Incorrect 145 ms 16408 KB Output isn't correct
19 Incorrect 201 ms 21432 KB Output isn't correct
20 Incorrect 230 ms 23772 KB Output isn't correct