TimberLee's blog

By TimberLee, history, 8 years ago, In English

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 ?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by TimberLee (previous revision, new revision, compare).

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

May be in 'ternaryY' high should be S — x instead of just S?