# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
91633 |
2018-12-28T19:14:53 Z |
KLPP |
Teams (IOI15_teams) |
C++14 |
|
4000 ms |
19288 KB |
#include "teams.h"
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
/*
4
2 4
1 2
2 3
2 3
2
2 1 3
2 1 1
*/
pair<int,int> arr[1000000];
int n;
void init(int N, int A[], int B[]) {
n=N;
for(int i=0;i<n;i++)arr[i]=pii(A[i],B[i]);
sort(arr,arr+n);
}
int can(int M, int K[]) {
sort(K,K+M);
int pnt=0;
priority_queue<int>pq;
for(int i=0;i<M;i++){
while(pnt<n && arr[pnt].first<=K[i]){
pq.push(arr[pnt].second);
pnt++;
}
while(pq.top()<K[i]){
if(pq.empty())return 0;
pq.pop();
}
for(int j=0;j<K[i];j++){
if(pq.empty())return 0;
pq.pop();
}
}return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
504 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
3064 KB |
Output is correct |
2 |
Correct |
15 ms |
3064 KB |
Output is correct |
3 |
Incorrect |
24 ms |
3700 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
3832 KB |
Output is correct |
2 |
Correct |
20 ms |
3836 KB |
Output is correct |
3 |
Execution timed out |
4005 ms |
4560 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
88 ms |
16376 KB |
Output is correct |
2 |
Correct |
89 ms |
16400 KB |
Output is correct |
3 |
Execution timed out |
4037 ms |
19288 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |