# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
886753 | byakko | Robots (IOI13_robots) | C++17 | 141 ms | 4720 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 <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 10;
bool check(int X[], int A, int W[], int T, int k) {
int cur = 0;
for(int i = 0; i < T; i += k) {
int end = min(T, i + k);
for(int j = i; j < end; j++)
if(X[cur] <= W[j]) return false;
cur++;
}
return true;
}
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
if(B == 0) {
sort(X, X + A);
reverse(X, X + A);
sort(W, W + T);
reverse(W, W + T);
if(!check(X, A, W, T, T)) return -1;
int lo = 0, hi = T;
while(lo + 1 < hi) {
int mid = (lo + hi) >> 1;
if(check(X, A, W, T, mid)) hi = mid;
else lo = mid;
}
# | 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... |