my_tempo's blog

By my_tempo, 3 years ago, In English

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..

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Check the second example for $$$f(x, y)$$$:

Unable to parse markup [type=CF_MATHJAX]

,

Unable to parse markup [type=CF_MATHJAX]

. Another counterexample would be $$$x = 3$$$ and

Unable to parse markup [type=CF_MATHJAX]

:

Unable to parse markup [type=CF_MATHJAX]

, whereas

Unable to parse markup [type=CF_MATHJAX]

.
»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

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