Ad
  • Custom User Avatar

    Sorry you didn't like my response, sometimes reading the instructions again helps, now that I told you why those numbers can't be in the answer, because I did and only then suggested you read the instructions again. Again, you're not understanding what to do, you're looking at 658 as going from 6 to 8 and from 8 to 5 and you analize that pattern, right? And that's not what you should do, you saw 369, but that number can be 658 amongst others as I already explained. If you don't like my answer, just say "I don't get it", there is no shame in that, and I will try to explain it to you in another way, but please, next time, just be humble and read the instructions again now that you got new information and keep an open mind. After all, it's you who didn't get what to do and I am trying to help you.

  • Custom User Avatar

    From 369 you can reach 658 going always horizontally or vertically: from 3 to 6, 6 to 5 and 9 to 8. From 6, you can only reach 2 diagonally and the same happens when you try to go from 9 to 5. So no, 325 isn't valid. You're confused about what you should do, you start with a number, let's say 369, but you're not sure that's the number the robber entered, the 3 could also be a 2 or a 6, but not a 5, etc. Read the instructions again.

  • Custom User Avatar

    Yes, returning ACA kills you by your own actions. A proper way to win here is ACBA. I added this to sample tests.

  • Default User Avatar

    yet another happy customer, what an easy job

  • Custom User Avatar

    it is possible that each of the digits he saw could actually be another adjacent digit (horizontally or vertically, but not diagonally).

    See the keypad again, 3 and 5 are adjacent, but diagonally.

  • Custom User Avatar

    There is this mechanism which sometimes, under some circumstances, allows users to see the most recently attempted solution of another user. It is somewhat buggy and does not work always, but I was able to see one of your solutions, copy it, and test it.

  • Custom User Avatar

    Sorry, we can't tell you whats wrong woth your code without seeing your code.

  • Custom User Avatar

    As I said, all inputs are below 5000. However, your solution does seem to be too slow: for some inputs it works well, for many inputs it seems to take 300-800ms, and for some very unfavorable inputs like n=4771,k=4331 or n=4703,k=4744 it seems to run for ~1.5s. Considering that there is 40 random tests, it seems that your solution is very likely to time out.

  • Custom User Avatar

    In Python, both n and k can go up to 5000.