제출 #16494

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
164942015-08-26 12:46:29CodingBug로봇 (IOI13_robots)C++98
0 / 100
4 ms14080 KiB
#include "robots.h"
#include <queue>
#include <algorithm>
#define N 50000
#define M 1000000
using namespace std;
typedef pair<int,int> ppair;
int a[N+1],b[N+1],na,nb,m;
ppair s[M+1];
priority_queue<int> Q;
bool check(int lmt){
int i,j,k;
for(i=0,j=0;i<na;i++){
for(;j<m && s[j].first<a[i];j++) Q.push(s[j].second);
for(k=0;k<lmt && !Q.empty();k++) Q.pop();
}
for(;j<m;j++) Q.push(s[j].second);
for(i=nb-1;i>=0;i--){
for(k=0;k<lmt && !Q.empty() && Q.top()<b[i];k++) Q.pop();
}
return Q.empty();
}
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
int i;
na=A; nb=B; m=T;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...