restart.'s blog

By restart., 9 years ago, In English

How could i solve this problem lightoj-1056 using binary search? i solved some problems using binary search. please anybody can help me what should be my strategy to solve this problem using binary search??

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

»
9 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

I don't think binary search is needed . Since arcs are part of same circle , so first determine the radius r. From triangle (r,l/2,w/2 ) we get r^2=(l/2)^2 + (w/2)^2 From (r,r,w) triangle sector angle from cos law. then arc= angle *r so the perimeter of stadium is 2*l + 2*arc and you can get ratio=400/(2*l + 2*arc) then ans is l*ratio , w*ratio

Hope it helps . :)