623 - 500!

All about problems in Volume 6. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Post by sohel » Fri Dec 08, 2006 12:31 pm

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

sakhassan
Experienced poster
Posts: 105
Joined: Sat Mar 11, 2006 9:42 am
Location: cse,DU

Post by sakhassan » Fri Dec 08, 2006 6:40 pm

Thanks for ur half solution ...... I just wanna check whether those input generates correct answer or not
Time that gone is gone forever ...

User avatar
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra » Sat Dec 23, 2006 10:12 pm

See Art_of_Programming_Contest_SE_for_uva.pdf

for hint
Akash chhoyar swopno
Dream to touch the sky

joebin
New poster
Posts: 12
Joined: Fri Dec 29, 2006 7:18 am
Location: Taiwan
Contact:

623 Got RE?

Post by joebin » Sat Dec 30, 2006 3:00 pm

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?
Last edited by joebin on Mon Jan 08, 2007 6:23 am, edited 4 times in total.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Thu Jan 04, 2007 2:04 pm

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.
Ami ekhono shopno dekhi...
HomePage

joebin
New poster
Posts: 12
Joined: Fri Dec 29, 2006 7:18 am
Location: Taiwan
Contact:

thx!!

Post by joebin » Thu Jan 04, 2007 2:27 pm

Now i got AC !!

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Re: thx!!

Post by emotional blind » Thu Jan 04, 2007 9:00 pm

joebin wrote:Now i got AC !!
You should Remove your code now. isnt it?

joebin
New poster
Posts: 12
Joined: Fri Dec 29, 2006 7:18 am
Location: Taiwan
Contact:

remove

Post by joebin » Fri Jan 05, 2007 6:49 am

sorry!!
Last edited by joebin on Mon Jan 08, 2007 6:24 am, edited 1 time in total.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Fri Jan 05, 2007 12:45 pm

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.
Ami ekhono shopno dekhi...
HomePage

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Fri Jan 05, 2007 6:45 pm

It seems Joebin is very much angry with me. :-?

joebin
New poster
Posts: 12
Joined: Fri Dec 29, 2006 7:18 am
Location: Taiwan
Contact:

Post by joebin » Sat Jan 06, 2007 11:22 am

Mm......
not at all
because my english is not good
maybe i misunderstood your reply
sorry!!

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Sat Jan 06, 2007 1:23 pm

joebin wrote:Mm......
not at all
because my english is not good
maybe i misunderstood your reply
sorry!!
Thanks for not posting it again.

diego andres de barros
New poster
Posts: 5
Joined: Mon Jul 10, 2006 3:37 pm

623

Post by diego andres de barros » Sat Feb 24, 2007 12:23 am

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

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo » Sat Feb 24, 2007 4:09 am

There are many threads on this problem..
Don't create a new thread if there is one already..

Md.Arafat Hossain
New poster
Posts: 7
Joined: Fri Mar 02, 2007 10:20 am

RE of 623

Post by Md.Arafat Hossain » Sat Mar 03, 2007 6:10 am

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;}

Post Reply

Return to “Volume 6 (600-699)”