GOOGLE APAC 2017 ROUND A PROBLEM 3

Revision en2, by ankeshgupta007, 2016-07-16 10:20:59

PROBLEM: https://code.google.com/codejam/contest/11274486/dashboard#s=p2 (JANE FLOWERSHOP)

i am getting wrong answer on large subtask. i used similar concept as binary search and went on digging near to the root of the equation using property that f(x) has a root between a and b if f(a)*f(b)<0 . it works for sample cases also. code: https://gist.github.com/ankesh007/f9e44d3cdf8ed5d8e3e218167c6272a1

please help/share approach.

Tags apac 2017, google apac

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ankeshgupta007 2016-07-16 10:20:59 21 Tiny change: 'hboard#s=p1\n\ni am g' -> 'hboard#s=p2\n(JANE FLOWERSHOP)\n\ni am g'
en1 English ankeshgupta007 2016-07-16 10:10:28 454 Initial revision (published)