Временно Codeforces по техническим причинам работает в ограниченном режиме (исторические данные недоступны). Это будет исправлено в ближайшие часы. ×

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

Автор minus_M1, история, 7 часов назад, По-английски

So I recently saw this problem in one of the blogs and someone claimed to have solved is using brute force, so I gave it a try and it seems that this 3100 rated has weak tc. When I tried to submit using some optimisations, it got accepted (311356622). Can anyone tell any reason why is it so?

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

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

It's probably not that there are weak testcases but that it's a badly set problem. You've got 3s TL with $$$10^5$$$ constraints that can be answered in very lightweight $$$O(N)$$$ — that's just asking for trouble. It's a common difficulty as a problemsetter to cleanly differentiate a heavy solution that has a better asymptotic complexity versus a very light solution with worse asymptotic complexity, while also keeping the time limit within reason — and it just seems the authors failed to do that here.

So yeah, the optimizations do help a lot, but if the problem was set with more care, it still wouldn't pass. The author in the editorial apologizes for not testing with pragmas, and it's a very old contest so fair enough — it's a more common trick nowadays (which I think shouldn't be allowed, but I digress)

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

    Thanks for clarifying!