이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robots.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
int putaway(int a, int b, int t, int x[], int y[], int w[], int s[])
{
sort(x,x+a);
sort(w,w+t);
if(x[a-1]<=w[t-1])
return -1;
int idx=0;
int arr[a];
for(int i=0;i<a;i++)
{
while(idx<t && w[idx]<x[i])
{
idx++;
}
arr[i]=idx;
}
int ans=999999999;
int l=1,r=t+1;
while(l<r)
{
int left=t;
int minus=0;
int time=(l+r)/2;
for(int i=0;i<a;i++)
{
left-=min(time,(arr[i]-minus));
minus+=min(time,(arr[i]-minus));
}
if(left==0)
{
ans=min(ans,time);
r=time;
}
else
l=time+1;
}
return ans;
}
# | 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... |