Submission #446925

#TimeUsernameProblemLanguageResultExecution timeMemory
446925ntarsisJob Scheduling (CEOI12_jobs)Pypy 3
0 / 100
313 ms65540 KiB
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 timeMemoryGrader output
Fetching results...