Page 9 of 13

Posted: Fri Dec 08, 2006 12:31 pm
by sohel
800!
77105301133538600.........
987!
43517228134065953.........

these are the first digits!
If you get this right, then I assume the others should be correct too.

And why are you specifically looking for these two outputs.. :-?

Posted: Fri Dec 08, 2006 6:40 pm
by sakhassan
Thanks for ur half solution ...... I just wanna check whether those input generates correct answer or not

Posted: Sat Dec 23, 2006 10:12 pm
by Debashis Maitra
See Art_of_Programming_Contest_SE_for_uva.pdf

for hint

623 Got RE?

Posted: Sat Dec 30, 2006 3:00 pm
by joebin
my program ran correctly in Borland C++ BuilderX 1.0 and got the right ans.

I doubt if acm can't use dynamic memory allocation.

or how to declare a 2570x1001 two-dimension array?

Posted: Thu Jan 04, 2007 2:04 pm
by Jan
Search your problem first. Dont open a new thread unless there is none.
joebin wrote:how to declare a 2570x1001 two-dimension array?
Simply declare it globally.

Code: Select all

#include<...>

int array[2570][1001];

int main()
{
    ...
    return 0;
}
Hope it helps.

thx!!

Posted: Thu Jan 04, 2007 2:27 pm
by joebin
Now i got AC !!

Re: thx!!

Posted: Thu Jan 04, 2007 9:00 pm
by emotional blind
joebin wrote:Now i got AC !!
You should Remove your code now. isnt it?

remove

Posted: Fri Jan 05, 2007 6:49 am
by joebin
sorry!!

Posted: Fri Jan 05, 2007 12:45 pm
by Jan
joebin, I think you haven't understood clearly. After logging in you can edit your post. Select the edit option and remove your code from that post.

Posted: Fri Jan 05, 2007 6:45 pm
by emotional blind
It seems Joebin is very much angry with me. :-?

Posted: Sat Jan 06, 2007 11:22 am
by joebin
Mm......
not at all
because my english is not good
maybe i misunderstood your reply
sorry!!

Posted: Sat Jan 06, 2007 1:23 pm
by emotional blind
joebin wrote:Mm......
not at all
because my english is not good
maybe i misunderstood your reply
sorry!!
Thanks for not posting it again.

623

Posted: Sat Feb 24, 2007 12:23 am
by diego andres de barros
please.....where is the error in my input????

#include<stdio.h>

#define MAX 10000

int m[MAX],pos,fix;
const int fixo=1000000;

int mul(int j);


int main(void){

int n,i;

while( scanf("%d",&n) ){
for(i=0;i<=MAX;i++)m=0;
pos=0;

m[0]=1;

for(i=2;i<=n;i++){
m[0]*=i;
fix =(m[0]/fixo);
m[0]=m[0]%fixo;
mul(i);
}//for

printf("%d!\n%d",n,m[pos]);

for(i=pos-1;i>=0;i--){
printf("%.6d",m);
}//for
printf("\n");



}
}//main


int mul(int j){
int i;

for(i=1;i<=pos;i++){
m*=j;
m+=fix;
fix=(m/fixo);
m=m%fixo;
}//for

if( m[pos+1]==0 && fix >0 ){
pos++;
m[pos]=fix;
}


}//mul

Posted: Sat Feb 24, 2007 4:09 am
by helloneo
There are many threads on this problem..
Don't create a new thread if there is one already..

RE of 623

Posted: Sat Mar 03, 2007 6:10 am
by Md.Arafat Hossain
Why it shows runtime error,please help me
Here is my code:
#include<iostream.h>


int main(){
int i,j,k,n,c=0,l,m,s;
int a[1200];

while(cin>>n){
if(n>1){
for(i=0;i<1200;i++)
a=-1;



i=1199;
j=n*(n-1);
while(j>9){
k=j%10;
a=k;
j=j/10;
i--;}
a=j;
for(l=n-2;l>=2;l--){
for(j=1199;j>=i;j--){
k=c+l*a[j];
s=j;
m=k%10;
a[s]=m;
k=k/10;
c=k;}
while(c>9){
m=c%10;
s--;
a[s]=m;
c=c/10;}
if(c>0){
s--;
a[s]=c;}
if(i>s) i=s;
c=0;}
cout<<n<<"!"<<endl;
for(l=i;l<1200;l++)
cout<<a[l];}
else
{if((n==1)||(n==0))
cout<<n<<"!"<<endl<<'1';}
cout<<endl;
}
return 0;}