Submission #362266

# Submission time Handle Problem Language Result Execution time Memory
362266 2021-02-02T12:27:58 Z AzizCherif Poi (IOI09_poi) C++14
0 / 100
354 ms 23996 KB
//ASSLEMA :)

#include <bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

typedef long long ll;
typedef double db;
typedef long double ldb;
//#define int ll //..................................................................
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<db> vdb;
typedef vector<string> vs;
typedef vector<pi> vpi;
typedef vector<pll> vpll;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define endl '\n'

ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }

void IO() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int32_t main(){
    boost; IO();
    int n, t, p;
    cin>>n>>t>>p;
    vector<vi> input(n);
    for(int i=0; i<n; i++){
        vi temp;
        for(int j=0; j<t; j++){
            int x; cin>>x;
            temp.pb(x);
        }
        input[i]=temp;
    }
    vi scores(t); 
    scores.assign(t, n);
    for(int i=0; i<t; i++){
        for(int j=0; j<n; j++){
            if(input[j][i]==1){
                scores[i]--;
            }
        }
    }
    vector<pair<pi, int>> board;//score, nb_poblems, ' ' , ID
    for(int i=0; i<n; i++){
        int sc=0, nb=0;
        for(int j=0; j<t; j++){
            if(input[i][j]==1){
                sc+=scores[j];
                nb++;
            }
        }
        board.pb(mp(mp(sc, nb), i+1));
    }
    sort(all(board));
    for(int i=0; i<n; i++){
        if(board[i].se==p){
            cout<<board[i].fi.fi<<' '<<i+1;
            break;
        }
    }
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Incorrect 1 ms 364 KB Output isn't correct
8 Incorrect 1 ms 364 KB Output isn't correct
9 Incorrect 2 ms 492 KB Output isn't correct
10 Incorrect 3 ms 492 KB Output isn't correct
11 Incorrect 11 ms 1004 KB Output isn't correct
12 Incorrect 17 ms 1516 KB Output isn't correct
13 Incorrect 50 ms 3948 KB Output isn't correct
14 Incorrect 72 ms 5484 KB Output isn't correct
15 Incorrect 128 ms 9324 KB Output isn't correct
16 Incorrect 143 ms 9964 KB Output isn't correct
17 Incorrect 209 ms 14572 KB Output isn't correct
18 Incorrect 240 ms 16508 KB Output isn't correct
19 Incorrect 314 ms 21668 KB Output isn't correct
20 Incorrect 354 ms 23996 KB Output isn't correct