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

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

Re: 10023 - Square root

Post by Bryton » Tue May 31, 2016 1:05 am

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.

metaphysis
Experienced poster
Posts: 129
Joined: Wed May 18, 2011 3:04 pm

Re: 10023 - Square root

Post by metaphysis » Fri Mar 02, 2018 1:24 pm

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

Post Reply

Return to “Volume 100 (10000-10099)”