Well, to stay away from precision issues, i just kept track of a variable i
called mul and for each iteration i multiplied the current digit by mul and
after that multiplied mul by the base, so for base 3 it goes from 1 to 3 to
9 and so on. When I had the special case when there was only one unique
digit and needed binary, like num = aaaaaaaaaaaaaaaaaaaaaaaaa, then i just
used bit shift like (1L << num.Length)-1. so i didn't use the pow at all.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to