Search found 7 matches

by a123123123888
Sat Dec 16, 2006 1:08 pm
Forum: Volume 4 (400-499)
Topic: 402 - M*A*S*H
Replies: 56
Views: 21673

No. The problem is not like that.

For first example:

start:1 2 3 4 5 6 7 8 9 10

1st card:

1 2 . 4 5 6 7 8 9 10

1 2 . 4 5 . 7 8 9 10

1 2 . 4 5 . 7 8 . 10

2nd card:

1 2 . 4 5 . . 8 . 10

3rd card:

1 2 . 4 . . . 8 . 10

4th card:

1 2 . . . . . 8 . 10

5th card:

1 . . . . . . 8 . 10

1 ...
by a123123123888
Tue Jul 11, 2006 10:47 am
Forum: Volume 6 (600-699)
Topic: 616 - Coconuts, Revisited
Replies: 37
Views: 18236

Because you have to check the result can be divide by people.

For example, 25.

(25-1)/3=8

so after first person, still 16 coconuts left.

(16-1)/3=5

so after second person, still 10 coconuts left.

and after third person, 6 coconuts left. ----> result

AND,

6 can be divide by 3, so 3 people is ...
by a123123123888
Tue Jul 04, 2006 10:51 am
Forum: Volume 108 (10800-10899)
Topic: 10856 - Recover Factorial
Replies: 17
Views: 17220

The table at last is like this:
Table[0]=0
Table[1]=0
Table[2]=1
Table[3]=1
Table[4]=2
Table[5]=1
Table[6]=2
Table[7]=1
Table[8]=3
...
This means the number's "factors" --> I don't know whether this word or not

Example
8 = 2 * 2 * 2
So Table[8]=3

to FAQ:

Table[4]+Table[3]+Table[6]+Table[2 ...
by a123123123888
Sun Jul 02, 2006 5:08 am
Forum: Volume 106 (10600-10699)
Topic: 10680 - LCM
Replies: 38
Views: 19678

10680 WA

Can anyone say where is wrong?
I try to solve it but fault :(
#define MAX 78599
int a[1000009];
int prime[MAX]={2,3,5},pows[168];
void calprime()
{
int i,j,k,flag;
for(i=3,j=7;i<MAX;j++,flag=1)
{
for(k=0;prime[k]*prime[k]<=j;k++)
if(j%prime[k]==0)
{
flag=0;
break;
}
if(flag)
prime[i ...
by a123123123888
Wed May 17, 2006 2:44 pm
Forum: Volume 101 (10100-10199)
Topic: 10106 - Product
Replies: 98
Views: 40280

..

For example,

Code: Select all

   3
   2
Your program print more.
by a123123123888
Tue May 16, 2006 5:39 pm
Forum: Volume 110 (11000-11099)
Topic: 11032 - Function Overloading
Replies: 43
Views: 22441

AC!


Actually the non-self-numbers generated by this formula
are about 20 000 only. Which is only about 2% of all
numbers generated by that formula. But still their existence
makes the problem harder.

Thank you for your hint!
I got AC. :)
But it used about 6.7sec...
Is there a faster method easy ...
by a123123123888
Tue May 16, 2006 2:44 pm
Forum: Volume 110 (11000-11099)
Topic: 11032 - Function Overloading
Replies: 43
Views: 22441

Can anyone post test cases?

I already WA many times :oops:
So I want to test where my code go wrong :)
Can anyone post test cases for me?

Go to advanced search