10023 - Square root

All about problems in Volume 100. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

New poster
Posts: 3
Joined: Mon Mar 14, 2016 6:12 pm

Re: 10023 - Square root

Post by Bryton »

In case anyone is struggling with WA using a Binary Search The Answer approach with Java BigInteger... The following statement may not currently apply to all the test input:
It is guaranteed, that for given Y , X will be always an integer.
I got AC by returning X - 1 in case binary search gave me a value such that X*X > Y.
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

Re: 10023 - Square root

Post by metaphysis »

Confirmed. I got AC by using method as Bryton said.
Post Reply

Return to “Volume 100 (10000-10099)”