# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446925 | ntarsis | Job Scheduling (CEOI12_jobs) | Pypy 3 | 313 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):
time = [0]*x
c = 0
ans = 0
for i in range(m):
if c == x:
c = 0
if time[c] >= nums[i]:
time[c]+=1
ans = max(ans,time[c]-nums[i])
else:
time[c]=nums[i]
c+=1
return ans <= d
lo = 1
hi = m
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... |