Блог пользователя my_tempo

Автор my_tempo, 3 года назад, По-английски

Take a quick look at this problem.
According to the given definitions of the functions, doesn't it make f(x,y) = gcd(x,y)?!
I can't think of why it's not true but the solution using this assumption is giving wrong answer.
I think I am missing something but I don't know what it is..

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

The link is not accessible . Maybe it is in gym section or it requires separate registration to accessm

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Check the second example for $$$f(x, y)$$$: $$$gcd(525, 63) = 21$$$, $$$f(525, 63) = 63$$$. Another counterexample would be $$$x = 3$$$ and $$$y = 9$$$: $$$gcd(3, 9) = 3$$$, whereas $$$f(3, 9) = 9$$$.

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

No it is not. You should make a correct brute-force solution, then you can make a loop to check if they are the same