[algogeeks] rise and fall of power

2011-10-03 Thread g4ur4v
can anyone please help me on how to approach this problem=
http://www.codechef.com/problems/MARCHA4

-- 
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.



Re: [algogeeks] rise and fall of power

2011-10-03 Thread Ankur Garg
Keep an array to store multiplication of numbers like for input

9 3
U have to compute 9^9

So an array to store the digits and do simple multiplication like 9*9  will
give 81 so Array will have 81

then 81*9  729  ..so on

Then output the first k digits and last k digits of the array

Any1 having a better solution ?

On Mon, Oct 3, 2011 at 11:48 PM, g4ur4v gauravyadav1...@gmail.com wrote:

 can anyone please help me on how to approach this problem=
 http://www.codechef.com/problems/MARCHA4

 --
 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.



-- 
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.



Re: [algogeeks] rise and fall of power

2011-10-03 Thread gaurav yadav
since 1 ≤ *n* ≤ 109

so for n=10^9  you would need an array of size (10^9)^(10^9) which is not
possible..
so your approach wont help.

-- 
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.