Submission #419400

# Submission time Handle Problem Language Result Execution time Memory
419400 2021-06-07T04:59:49 Z chirathnirodha Poi (IOI09_poi) C++17
5 / 100
437 ms 4464 KB
//Coded by Chirath Nirodha
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define I insert
#define P push
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_tree;
const ll mod=1e9+7;
inline void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void solve(){
    io();
    int n,t,p;cin>>n>>t>>p;p--;
    bool arr[n][t];
    for(int i=0;i<n;i++)for(int j=0;j<t;j++)cin>>arr[i][j];
    ll points[t];
    for(int j=0;j<t;j++){
        points[j]=0;
        for(int i=0;i<n;i++)if(!arr[i][j])points[j]++;
    }
    vector<pair<ll,pair<int,int> > > rank; 
    for(int i=0;i<n;i++){
        ll x=0,y=0;
        for(int j=0;j<t;j++)if(arr[i][j]){x+=points[j];y++;}
        rank.PB(MP(x,MP(y,-i)));
    }
    sort(rank.begin(),rank.end());
    for(int i=n-1;i>=0;i--){
        if(rank[i].S.S==p){cout<<rank[i].F<<" "<<n-i<<endl;return;}
    }
}
int main(){
    io();
    solve();
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB Output isn't correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Incorrect 1 ms 204 KB Output isn't correct
9 Incorrect 2 ms 204 KB Output isn't correct
10 Incorrect 5 ms 332 KB Output isn't correct
11 Incorrect 16 ms 420 KB Output isn't correct
12 Incorrect 21 ms 460 KB Output isn't correct
13 Incorrect 61 ms 996 KB Output isn't correct
14 Incorrect 86 ms 1260 KB Output isn't correct
15 Incorrect 152 ms 1860 KB Output isn't correct
16 Incorrect 163 ms 2008 KB Output isn't correct
17 Incorrect 240 ms 2780 KB Output isn't correct
18 Incorrect 267 ms 3080 KB Output isn't correct
19 Incorrect 378 ms 3944 KB Output isn't correct
20 Incorrect 437 ms 4464 KB Output isn't correct