제출 #376022

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3760222021-03-10 17:05:30wind_reaper로봇 (IOI13_robots)C++17
100 / 100
2234 ms29368 KiB
#include <bits/stdc++.h>
#include "robots.h"
using namespace std;
const int MXT = 1000000;
const int MXN = 50000;
int a, b, x[MXN], y[MXN], t;
pair<int, int> toy[MXT];
bool check(int mid){
priority_queue<pair<int, int>> pq;
int taken = 0;
for(int i = 0; i < a; i++){
for(; taken < t && toy[taken].first < x[i]; taken++)
pq.emplace(toy[taken].second, toy[taken].first);
for(int r = 0; r < mid && !pq.empty(); r++)
pq.pop();
}
for(; taken < t; taken++)
pq.emplace(toy[taken].second, toy[taken].first);
for(int i = 0; i < b; i++){
for(int r = 0; r < mid && !pq.empty(); r++){
if(pq.top().first >= y[i]) return 0;
pq.pop();
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...