# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39327 | 14kg | Robots (IOI13_robots) | C++11 | 2209 ms | 22492 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 "robots.h"
#include <algorithm>
#include <queue>
#include <functional>
#define N 1000001
#define max2(x,y) (x>y?x:y)
using namespace std;
int len_a, len_b, len_toy, pass_len;
int A[50001], B[500010], pass[N];
pair<int, int> toy[N];
priority_queue<int,vector<int>,greater<int> > Q;
bool Can(int max_size) {
int k = len_a;
long long r_size = 0;
pass_len = 0;
while (!Q.empty()) Q.pop();
for (int i = len_toy; i >= 1; i--) {
while (toy[i].first <= A[k]) k--, r_size += (long long)max_size;
r_size--, Q.push(toy[i].second);
if (r_size < 0) pass[++pass_len] = Q.top(), Q.pop(), r_size++;
}
sort(pass + 1, pass + pass_len + 1);
k = len_b + 1, r_size = 0;
for (int i = pass_len; i >= 1; i--) {
if (!r_size) k--, r_size = (long long)max_size;
# | 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... |