View Single Post
Old 2021-11-25, 21:08   #4
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

156710 Posts
Default

Quote:
Originally Posted by hunson View Post
guess the idea was not half bad, but its the slower solution. The loop method takes 3 sec. on my machine and the GMP implementation 0 sec.
At least my idea works
Up to constant factor it should be the same speed.
Then analyse how much memory your code needs. Also if you'd contruct all integers in that way then your code runs in quadratic time and needs much more memory.
R. Gerbicz is offline   Reply With Quote