제출 #965518

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9655182024-04-18 18:50:02ThegeekKnight16로봇 (IOI13_robots)C++17
76 / 100
3044 ms34452 KiB
#include <bits/stdc++.h>
#include "robots.h"
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
bool Test(int x, int A, int B, int T, int *X, int *Y, const vector<pair<int, int>> &Toy)
{
if ((long long)x*(A+B) < T) return 0;
vector<int> sweep; //id
sweep.reserve(max(A, B)+T);
int idT = 0, idA = 0;
while (idT < T && idA < A)
{
if (X[idA] <= Toy[idT].first) sweep.push_back(-1), idA++;
else sweep.push_back(idT++);
}
while (idT < T) sweep.push_back(idT++);
while (idA < A) sweep.push_back(-1), idA++;
multiset<int> remain;
for (auto id : sweep)
{
if (id == -1)
{
int remov = x;
while (remov > 0 && !remain.empty()) remain.erase(prev(remain.end())), --remov;
}
else remain.insert(Toy[id].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...