# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446922 | ntarsis | Job Scheduling (CEOI12_jobs) | Pypy 3 | 350 ms | 65540 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.
n,d,m = map(int,input().split())
nums = [int(x) for x in input().split()]
nums.sort()
def check(x):
thing = [0]*m
count = 1
curr = 0
right = 0
while right < m:
while right < min(m,curr+x):
if nums[right]<=count:
thing[right]=count
right+=1
else:
curr = right
count+=1
count+=1
curr+=x
final = 0
for i in range(m):
if thing[i]-nums[i]>final:
final = thing[i]-nums[i]
return final <= d
lo = 1
hi = n
while lo < hi:
mid = (lo+hi)//2
if check(mid):
hi = mid
else:
lo = mid+1
print(lo)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |