Submission #31905

# Submission time Handle Problem Language Result Execution time Memory
31905 2017-09-12T16:48:28 Z top34051 Teams (IOI15_teams) C++14
0 / 100
36 ms 6712 KB
#include "teams.h"
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005

int n;
pair<int,int> p[maxn];
priority_queue<int> heap;

void init(int N, int A[], int B[]) {
    n = N;
    for(int i=0;i<n;i++) p[i] = {A[i], B[i]};
    sort(&p[0],&p[n]);
}

int can(int M, int K[]) {
    int i,j;
    while(!heap.empty()) heap.pop();
    for(i=0,j=0;i<M;i++) {
        while(j<n && p[j].first<=K[i]) heap.push(-p[j++].second);
        while(!heap.empty() && -heap.top()<K[i]) heap.pop();
        if(heap.empty()) return 0;
        heap.pop();
    }
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2800 KB Output is correct
2 Incorrect 0 ms 2800 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 3584 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 3980 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 36 ms 6712 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -