Submission #31468

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
314682017-08-27 16:33:40top34051Robots (IOI13_robots)C++14
100 / 100
2306 ms20748 KiB
#include "robots.h"
#include<bits/stdc++.h>
using namespace std;
int n,m,k;
int a[50005], b[50005];
pair<int,int> p[1000005];
priority_queue<pair<int,int> > heap;
bool check(int cnt) {
int i,j,cur;
j = 0;
while(!heap.empty()) heap.pop();
for(i=0;i<n;i++) {
while(j<k && p[j].second<a[i]) heap.push(p[j++]);
for(cur=0;cur<cnt && !heap.empty();cur++) heap.pop();
}
while(j<k) heap.push(p[j++]);
for(i=m-1;i>=0;i--) {
for(cur=0;cur<cnt && !heap.empty();cur++) {
if(heap.top().first>=b[i]) return 0;
if(!heap.empty()) heap.pop();
}
}
return heap.empty();
}
bool cmp(pair<int,int> x,pair<int,int> y) {
return x.second<y.second;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...