Tap here to switch tabs
Problem
Submissions

Problem: Find Minimum Time to Finish All Jobs II

med
30 min
Try to solve the Find Minimum Time to Finish All Jobs II problem.

Statement

You are given two 00 indexed integer arrays jobs and workers of equal length n, where jobs[i] represents the amount of work required to complete the iextthi^{ ext{th}} job, and workers[j] represents the daily work capacity of the jextthj^{ ext{th}} worker.

Each worker is assigned to exactly one job, and each job is assigned to exactly one worker. The time required for a worker with capacity workers[j] to finish a job with work jobs[i] is ⌈\lceil jobs[i] // workers[j] ⌉\rceil days. All workers work simultaneously on their assigned jobs.

Return the minimum number of days needed to complete all jobs under an optimal assignment.

Constraints:

  • n == jobs.length == workers.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq jobs[i], workers[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Minimum Time to Finish All Jobs II

med
30 min
Try to solve the Find Minimum Time to Finish All Jobs II problem.

Statement

You are given two 00 indexed integer arrays jobs and workers of equal length n, where jobs[i] represents the amount of work required to complete the iextthi^{ ext{th}} job, and workers[j] represents the daily work capacity of the jextthj^{ ext{th}} worker.

Each worker is assigned to exactly one job, and each job is assigned to exactly one worker. The time required for a worker with capacity workers[j] to finish a job with work jobs[i] is ⌈\lceil jobs[i] // workers[j] ⌉\rceil days. All workers work simultaneously on their assigned jobs.

Return the minimum number of days needed to complete all jobs under an optimal assignment.

Constraints:

  • n == jobs.length == workers.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq jobs[i], workers[i] ≤105\leq 10^5