For the bottom part you can determine the digits of the square root in reverse 
order. Even numbers are handled separately (drop the last two zeros and start 
over), so you can assume the last digit is 1.

2nd last digit is the most tricky - you have to try both (0 and 1) as you can't 
determine it from the start. From the 3rd last on, at most one value for each 
digit will match the last digits of the square. You don't have to calculate it 
with modulos and stuff, you can just try 0 and 1, square the numbers, and see 
which one (if any) matches a certain number of last digits of your square.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/01000e5b-067c-4e4b-b949-961a0ee1d809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to