SendThemToHell's blog

By SendThemToHell, history, 4 years ago, translation, In English

Today I have discovered a strange fact about problem D from SNSS round 5.

I believe, most of the accepted solutions were something like "do ternary search over the angle/x-coordinate". It was somewhat hard for me to squeeze it into TL, so I had to do only 20 iterations to get accepted. Today I decided to find out, what is the minimum number of iterations of ternary search required to get AC. Turned out that this number is equal to... 0. The code which gives AC is listed below.

Spoiler

I believe that this code takes the intersection of the bisector of AB and the circle as optimum, which is definitely wrong. Am I missing something?

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

»
4 years ago, # |
Rev. 2   Vote: I like it +25 Vote: I do not like it

Wait I wondered that too. My code did some nonsense but was getting correct answers on the examples and I didn't understand why it passed. Apparently puts("0.0") passes as well.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Wow, i just checked it, and even an empty file sent under python gets AC) It would be really interesting to see the number of solutions that actually pass all the testcases

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I can't understand if you guys are joking or for real you tried that and it gave AC.

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

It seems that custom checker from stock testlib (rcmp-6) loaded wrongly to the Yandex.Contest. (. I cannot understand reasons, so i changed to other builtin equivalent. Check if effect still stays...