don't calculate it till e*10^6..calculating it till 10000 would suffice . On Thu, Sep 27, 2012 at 9:03 AM, Wladimir Tavares <wladimir...@gmail.com>wrote:
> http://www.spoj.pl/problems/FACVSPOW/ > > Hi guys, > I'm trying to solve this problem but I'm getting TLE. > Basically, the problem wants to know when n! > (a ^ n) for a given (a <= > 1000 000). > > My basic idea was to pre-calculate all values n! for n <= e * 1000000 > using log. > > Then use binary search in the range [2 * a, (e * a)] to discover when n! > > a ^ n > > Anyone have any ideas? > > > Wladimir Araujo Tavares > *Federal University of Ceará <http://lia.ufc.br/%7Ewladimir/> > Homepage <http://lia.ufc.br/%7Ewladimir/> | > Maratona<https://sites.google.com/site/quixadamaratona/>| > * > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- -- Thanks Rahul Singh B.tech CSE ,final Year IIT Roorkee -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.