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;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
sort(S,S+T,greater<int>());
sort(X,X+A,greater<int>());
int ans=0;
int l=1,r=1e9;
while(l<=r){
int md=(l+r)/2,j=0;
bool is=1;
for(; j<A; j++){
for(int i=j*md; i<min(T,j*(md+1)); i++){
if(S[i]>=X[j])is=0;
}
}
if(is)l=md+1;
else r=ans=md;
}
return (ans?ans:-1);
}
# | 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... |