Submission #886753

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8867532023-12-12 21:17:55byakkoRobots (IOI13_robots)C++17
14 / 100
141 ms4720 KiB
#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;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...