Closest Divisor of given number problems

Правка en1, от SPyofgame, 2020-02-25 09:45:05

Question: Given two positive numbers N and M, find minimal |c — M| where N mod c = 0

Can we solve this problem in O(log (n)) or faster ?

Here is my approach in O(sqrt(n))

My code

Sorry for my bad English ;-;

If I have wrong something, please tell me. It is better to do that than just downvote me because I and someone will learn many new things <3

Теги #asking, #algorithms, #complexity, #optimization

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский SPyofgame 2020-02-25 09:45:05 772 Initial revision (published)