I got AC by returning X - 1 in case binary search gave me a value such that X*X > Y.It is guaranteed, that for given Y , X will be always an integer.
10023 - Square root
Moderator: Board moderators
Re: 10023 - Square root
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:
-
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
Re: 10023 - Square root
Confirmed. I got AC by using method as Bryton said.
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.