11415 - Count the Factorials
Moderator: Board moderators
-
- New poster
- Posts: 16
- Joined: Sun Mar 02, 2008 10:34 am
- Location: SUST , Sylhet, Bangladesh
11415 - Count the Factorials
I am continuous getting TLE!!
any one can give me good algo i can not found a faster algo
my algo
1. generate prime factor
2. linear search and count
if any good idea?
thanks
nikson
any one can give me good algo i can not found a faster algo
my algo
1. generate prime factor
2. linear search and count
if any good idea?
thanks
nikson
life is beautiful like coding
-
- New poster
- Posts: 16
- Joined: Sun Mar 02, 2008 10:34 am
- Location: SUST , Sylhet, Bangladesh
11415
i am strange no one can give me any idea.
but i get now ACC.
thanks
but i get now ACC.
thanks

life is beautiful like coding
-
- A great helper
- Posts: 281
- Joined: Tue Sep 10, 2002 5:14 am
- Location: Mountain View, CA, USA
- Contact:
Re: 11415 - Count the Factorials
What is the answer for n = 10000000? My WA program prints 3203899.
If only I had as much free time as I did in college...
Re: 11415 - Count the Factorials
My AC code givesAbednego wrote:What is the answer for n = 10000000? My WA program prints 3203899.
Code: Select all
2703663

-
- A great helper
- Posts: 281
- Joined: Tue Sep 10, 2002 5:14 am
- Location: Mountain View, CA, USA
- Contact:
Re: 11415 - Count the Factorials
Thanks, helloneo.
I'm confused though. Does anyone understand what the problem statement means by "1 is a prime". When do we count 1? How many times do we count 1?
Edit: Nevermind. I'm dumb. Fixed.
I'm confused though. Does anyone understand what the problem statement means by "1 is a prime". When do we count 1? How many times do we count 1?
Edit: Nevermind. I'm dumb. Fixed.
If only I had as much free time as I did in college...
Re: 11415 - Count the Factorials
I am getting TLE in this problem. please anybody help me...
here is my code :
Thanks in advance.
here is my code :
Code: Select all
removed....
Last edited by lazyboy on Sat Oct 03, 2009 12:50 am, edited 1 time in total.
Re: 11415 - Count the Factorials
your sieve & process funtion take more time
think modified sive
think modified sive
Re: 11415 - Count the Factorials
Thanks for ur reply MRH.
i am just modifying the sieve. but how can i make the process function more fast. please give me a little hints.
Thanks in advance.
i am just modifying the sieve. but how can i make the process function more fast. please give me a little hints.
Thanks in advance.
Re: 11415 - Count the Factorials
HI "lazyboy"
modified sive means your process funtion no need
this task can possible with sive
I hope now u can get ACC
it is enough hints
thanks in advance
modified sive means your process funtion no need
this task can possible with sive
I hope now u can get ACC
it is enough hints
thanks in advance
Re: 11415 - Count the Factorials
Thanks MRH.
Re: 11415 - Count the Factorials
Hi,
to solve this problem u need a clever way to generate the number of factors of factorial -( solve the problem 884)-
for each number in the range 1 -> 10 000 000 ... maybe the Algorithm used in the problem 884 isn't enough for this problem.... but it will help you to of course.
then it's easy to find a way to pre-compute the desired results using dp. (Searching for each input will give TLE).
Ahmad
to solve this problem u need a clever way to generate the number of factors of factorial -( solve the problem 884)-
for each number in the range 1 -> 10 000 000 ... maybe the Algorithm used in the problem 884 isn't enough for this problem.... but it will help you to of course.
then it's easy to find a way to pre-compute the desired results using dp. (Searching for each input will give TLE).
Ahmad