WA in Problem based on Ternary search. HELP!!

Revision en2, by TimberLee, 2016-06-07 23:18:53

I am trying to solve this problem using ternary search.

It asks to find the maximum of the function x^a·y^b·z^c. Where, x+y+z <= S.

I submitted the following solution which is giving WA. link

However, this AC solution is very similar.

Can somebody help ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English TimberLee 2016-06-07 23:18:53 313
en1 English TimberLee 2016-05-31 18:26:00 387 Initial revision (published)