Get Min Operations
There are n jobs that can be executed in parallel on a processor, where the execution time of the ith job is executionTime[i]. To spped up execution, the following strategy is used.
In one operation, a job is chosen, the major job, and is executed for x seconds. All other jobs are executed for y seconds where y < x.
A job is complete when it has been executed for at least executionTime[i] seconds, the it exits the pool. Find the min num of operations in which the processor can completely execute all the jobs if run optimally.
Complete the function citadelGetMinOperations in the editor ππ.
citadelGetMinOperations has the following parameters:
int executionTime[n]: the execution times for each jobint x: the time for which the major job is executedint y: the time for which all other jobs are executed executed
Returns
int: the min number of operations in which the processor can complete the jobs
P.S. I'll hold off on uploading the source image for now since it needs too much mosaic effect to hide the sensitive information, and I'm feeling a bit lazyyy π΅ I am 1000% sure everything matches the original source π GOOOD LUCK, my Citadel friends! >~<
Key insight:
β«βqβͺ βΛβ¬ οΎπ³ Credit to da best, rachel and Aura Man! You both are truly amazing!!Λπ¦α°.α
1Example 1
2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.
1 <= n <= 3 * 10^51 <= executionTime[i] <= 10^91 <= y < x <= 10^9