
10856 - Recover Factorial
Moderator: Board moderators
10856 - Recover Factorial
How is this problem solved? It appears everybody but me solved it 

-
- Experienced poster
- Posts: 120
- Joined: Sat Nov 01, 2003 6:16 am
- Location: Dhaka (EWU)
-
- Experienced poster
- Posts: 120
- Joined: Sat Nov 01, 2003 6:16 am
- Location: Dhaka (EWU)
Hi
Try this Input
Input
Output
I think this is the most tricky Input for this problem.
Thanks
MAP
Try this Input
Input
Code: Select all
0
1
10000001
-200
Code: Select all
Case 1: 0!
Case 2: 2!
Case 3: 2703663!
Thanks
MAP
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
10856
0! = 1
am i right? i think so is not possible this case.
am i right? i think so is not possible this case.
-
- Experienced poster
- Posts: 120
- Joined: Sat Nov 01, 2003 6:16 am
- Location: Dhaka (EWU)
Hi ibrahim
suppose you have a list of prime number
- prime[] = {2,3,5,7,11,13,17,19,23,29,............................}
- and my concept is if a number is divisible by a prime number then it is suffice for find out total number of prime factor.
exp - if we have a number 12
then we have to check which prime number is divisible then 2 will be come and
then ans will be Table = Table[i / prime[j]] + Table[prime[j]];
here i = 12
prime[j] = 2
then Table[12] = Table[12/2] + Table[2]
then we can easily find out Table[12] = 3:-?
and it will be continue up to 2703665
- then binary search
thanks
MAP
suppose you have a list of prime number
- prime[] = {2,3,5,7,11,13,17,19,23,29,............................}
- and my concept is if a number is divisible by a prime number then it is suffice for find out total number of prime factor.
exp - if we have a number 12
then we have to check which prime number is divisible then 2 will be come and
then ans will be Table = Table[i / prime[j]] + Table[prime[j]];
here i = 12
prime[j] = 2
then Table[12] = Table[12/2] + Table[2]
then we can easily find out Table[12] = 3:-?
and it will be continue up to 2703665
- then binary search
thanks

MAP
-
- New poster
- Posts: 42
- Joined: Sun Jul 31, 2005 2:07 am
- Location: SUST. Bangladesh
- Contact:
-
- New poster
- Posts: 7
- Joined: Fri Mar 31, 2006 1:22 pm
The table at last is like this:
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:
means
and obviously not equal to Table [12].
By the way, it's not necessary to calculate prime numbers.
Code: Select all
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
...
Example
8 = 2 * 2 * 2
So Table[8]=3
to FAQ:
Code: Select all
Table[4]+Table[3]+Table[6]+Table[2]
Code: Select all
Table [ 4 * 3 * 6 * 2 ] = Table[144]
By the way, it's not necessary to calculate prime numbers.