13,449,194 members (52,425 online)

# Algorithms

 Re: Specify numbers as product of Primes? Ian Uy26-Jun-08 17:51 Ian Uy 26-Jun-08 17:51
 Re: Specify numbers as product of Primes? cp987629-Jun-08 14:57 cp9876 29-Jun-08 14:57
 Re: Specify numbers as product of Primes? Arash Partow29-Jun-08 0:48 Arash Partow 29-Jun-08 0:48
 Re: Specify numbers as product of Primes? [modified] cp987629-Jun-08 3:53 cp9876 29-Jun-08 3:53
 Re: Specify numbers as product of Primes? Luc Pattyn29-Jun-08 4:40 Luc Pattyn 29-Jun-08 4:40
 Re: Specify numbers as product of Primes? cp987629-Jun-08 14:47 cp9876 29-Jun-08 14:47
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 2:54 Arash Partow 30-Jun-08 2:54
 Re: Specify numbers as product of Primes? cp987630-Jun-08 3:18 cp9876 30-Jun-08 3:18
 Arash Partow wrote:I believe this is not correct, assume you have an x composed from 2p where p is a prime, in this case it is clear that in certain circumstance sqrt(x) can be less than p (eg: 15838 = 7919 * 2, where 7919 > sqrt(15838)), for primal testing the sqrt(n) bound is ok, however its not suitable for the upper bound in this problem. He's studying for the ACM competition - I don't want to spoon feed him! He can limit his testing to sqrt(N) but he has to modify his algorithm slightly for when InputCase is not 1 at the end. In the example you give, he only needs to test until floor(sqrt(15838))=125, he will have only found 2 as a factor and InputCase will be 7919 after the 124 tests. He can then conclude the the remaining value in InputCase is the remaining prime factor. This is much more efficient than testing the remaining 15,703 factors. Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 4:27 Arash Partow 30-Jun-08 4:27
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 2:17 Arash Partow 30-Jun-08 2:17
 Polyline offset algorithm beko16-Jun-08 21:59 beko 16-Jun-08 21:59
 Re: Polyline offset algorithm Alan Balkany17-Jun-08 4:07 Alan Balkany 17-Jun-08 4:07
 Re: Polyline offset algorithm beko17-Jun-08 4:43 beko 17-Jun-08 4:43
 Re: Polyline offset algorithm CPallini17-Jun-08 7:03 CPallini 17-Jun-08 7:03
 Re: Polyline offset algorithm beko17-Jun-08 8:26 beko 17-Jun-08 8:26
 Re: Polyline offset algorithm cp987617-Jun-08 12:10 cp9876 17-Jun-08 12:10
 Re: Polyline offset algorithm Arash Partow18-Jun-08 1:22 Arash Partow 18-Jun-08 1:22
 Re: Polyline offset algorithm beko18-Jun-08 19:55 beko 18-Jun-08 19:55
 need similar to Excel's "Goal Seek" in C/C++ KimN6-May-08 9:04 KimN 6-May-08 9:04
 Re: need similar to Excel's "Goal Seek" in C/C++ 73Zeppelin6-May-08 9:17 73Zeppelin 6-May-08 9:17
 Re: need similar to Excel's "Goal Seek" in C/C++ KimN6-May-08 10:06 KimN 6-May-08 10:06
 Re: need similar to Excel's "Goal Seek" in C/C++ 73Zeppelin6-May-08 10:29 73Zeppelin 6-May-08 10:29
 Re: need similar to Excel's "Goal Seek" in C/C++ cp98766-May-08 15:57 cp9876 6-May-08 15:57
 Re: need similar to Excel's "Goal Seek" in C/C++ 73Zeppelin6-May-08 19:19 73Zeppelin 6-May-08 19:19
 How is BitBlt implemented [modified] Force Code15-Nov-07 8:15 Force Code 15-Nov-07 8:15
 Last Visit: 31-Dec-99 18:00     Last Update: 19-Mar-18 9:32 Refresh « Prev1...474849505152535455 Next »