# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102949 | wxh010910 | Robots (IOI13_robots) | C++17 | 3 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "robots.h"
using namespace std;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
sort(X, X + A);
sort(Y, Y + B);
vector<pair<int, int>> p(T);
for (int i = 0; i < T; ++i) {
p[i] = make_pair(W[i], S[i]);
if ((!A || W[i] >= X[A - 1]) && (!B || S[i] >= Y[B - 1])) {
return -1;
}
}
sort(p.begin(), p.end());
auto check = [&](int t) {
priority_queue<int> q;
int ptr = 0;
for (int i = 0; i < A; ++i) {
while (ptr < T && p[ptr].first < X[i]) {
q.push(p[ptr++].second);
}
for (int j = 0; j < t && !q.empty(); ++j) {
q.pop();
}
}
while (ptr < T) {
q.push(p[ptr++].second);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |