Re: [algogeeks] Re: Spoj Problem : Small Factorials

2011-02-05 Thread UTKARSH SRIVASTAV
#includestdio.h long int k; void fact(long int a[],long int n) { long int c=0,temp,i=0; while(i=k) { temp=a[i]*n+c; a[i]=temp%10; c=temp/10; i++; } while(c!=0) { a[i]=c%10; c=c/10; k++; i++; } } main() {

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
@jeeva Can you pls explain me in detail or some link to the tutorial of string manipulation in C++. I googled about it but most of the links are in Python Javascript. On Feb 4, 9:29 pm, subramania jeeva subramaniaje...@gmail.com wrote: Use string multiplication. :) Cheers           ~ Jeeva ~

Re: [algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread abhijith reddy
http://zobayer.blogspot.com/2010/03/small-bigint-library.html On Fri, Feb 4, 2011 at 10:24 PM, Rahul Verma rahulverma@gmail.comwrote: @jeeva Can you pls explain me in detail or some link to the tutorial of string manipulation in C++. I googled about it but most of the links are in Python

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Dave
@Rahul: Given that 100! 100^100 = 10^200, we know that 100! has less than 200 digits. Assuming 32-bit integers, we might choose to store anywhere from 1 to 7 digits in an integer, realizing that we have to multiply the integer by a number up to 100 and still want the result to be less than 2^31.

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
@Dave In the line t=p/100; what is the value of p here or what it means? On Feb 4, 9:57 pm, Dave dave_and_da...@juno.com wrote: @Rahul: Given that 100! 100^100 = 10^200, we know that 100! has less than 200 digits. Assuming 32-bit integers, we might choose to store anywhere from 1 to 7

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Dave
Oh. That is supposed to be t. So the line actually could read t /= 1; Sorry for the typo. Dave On Feb 4, 11:58 am, Rahul Verma rahulverma@gmail.com wrote: @Dave In the line t=p/100; what is the value of p here or what it means? On Feb 4, 9:57 pm, Dave

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
Thanx to all @above. I got the result ACC. On Feb 5, 12:45 am, sunny agrawal sunny816.i...@gmail.com wrote: http://www.codechef.com/wiki/tutorial-small-factorials On Fri, Feb 4, 2011 at 11:52 PM, Dave dave_and_da...@juno.com wrote: Oh. That is supposed to be t. So the line actually