We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Minimum Time Required
Minimum Time Required
Sort by
recency
|
156 Discussions
|
Please Login in order to post a comment
My Java 8 solution, based on a simple Binary Search approach, passing all test cases, for Max Score of 35. Code is fairly self-explanatory.
ez
let M be the min element of machines, then M*goal is 10^18 at most = 2^64 at most
O(n * log(M * goal)), the log cannot exceed 64
why is this TLE? I am using binary search and the last for loop -- couldn't possibly go too much back.
The binary search is certainly a great idea, but solutions I see all start from 0 or 1. The minum days is fastest-machine/number-of-machines * item_targets and the maxium days is slowest-machine/number-of-machines * item_targets: