I wanted to know an efficient algorithm to calculate the product of divisors..
My brute force method is giving me a Time limit exceeded.
catchmrbharath
0
Light Poster
Recommended Answers
Jump to PostGoogle is your friend.
http://www.mathlinks.ro/viewtopic.php?t=277509
http://en.wikipedia.org/wiki/Divisor_function
I guess you can use that there. :)
Jump to PostI can't understand why your brutal force algorithm is so expensive (apropos, where is this algorithm? ;))
Numbers in range 1..1000000 have less than ~65 divisors. It's so easy to get all divisors by brutal force test (n%k == 0) then (or on the fly) to multiply some tens …
All 7 Replies
Sky Diploma
571
Practically a Posting Shark
ArkM
1,090
Postaholic
Sky Diploma
571
Practically a Posting Shark
siddhant3s
1,429
Practically a Posting Shark
catchmrbharath
0
Light Poster
catchmrbharath
0
Light Poster
ArkM
1,090
Postaholic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.