Submission #220689

#TimeUsernameProblemLanguageResultExecution timeMemory
220689VEGAnnTeams (IOI15_teams)C++14
0 / 100
4081 ms8988 KiB
#include <bits/stdc++.h>
#include "teams.h"
#define pii pair<int,int>
#define ft first
#define sd second
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
using namespace std;
vector<pii> vc;
int n;

void init(int N, int A[], int B[]) {
    n = N;

    vc.clear();

    for (int i = 0; i < n; i++)
        vc.PB(MP(B[i], A[i]));

    sort(all(vc));
}

int can(int M, int K[]) {

    sort(K, K + M);

    int it = 0;

    for (int i = 0; i < M; i++){
        int kol = K[i];

        while (it < n && kol > 0){
            if (vc[it].ft >= K[i] && vc[it].sd <= K[i])
                kol--;
            it++;
        }

        if (kol > 0)
            return 0;
    }

	return 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...