### Kanao's blog

By Kanao, history, 7 weeks ago,

Can someone help me with Step-2 C: Very Easy Task

My Approach: if the task can be done in T time, then 1(good) else 0 (bad). So, making 1 copy of the original document will take min(x,y) time, and then both copy machines can simultaneously work.

we need to check whether n copies can be made in T time or not, if I am updating T1 = T-min(x,y) and then checking that can I make n-1 copies in T1 time. Then find the first occurrence of 1 using binary search. It is throwing me an error "Wrong Answer on test case 5"

Code

Actual Approach : we need to check whether n-1 copies can be made in T time or not. Then, by using binary search find the first occurrence of 1 as it will be the least time to make n-1 copies, and then adding min(x,y) as it will be the time to make the copy of original.

AC Code

I dont know, where am I making mistake, both logics seems similar to me.

• 0

 » 7 weeks ago, # |   0 Auto comment: topic has been updated by Kanao (previous revision, new revision, compare).