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

Автор unt311, история, 5 лет назад, По-английски

I am very unhappy with getting TLE in recent contests for submissions that were of the exact same complexity as the editorial I saw afterwards :

  1. Happened in D problem of the latest Div3. My nlog(n) submission didn't pass(TLE).

  2. Again happened in C problem of Divide by zero contest. My O(n) solution didn't pass (TLE).

  3. Again happened today problem B (last div2) My optimal solution didn't pass (TLE) (Editorial isn't out yet, but I wasn't expecting TLE at all)

Do I mess up everytime or is CF behaving unfair with me ?

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

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +24 Проголосовать: не нравится
  1. I replaced {} with 0 which now gives runtime error 112878381
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +64 Проголосовать: не нравится
  1. That's because of undefined behaviour. You sometimes erase an element which doesn't exist, which can in some cases lead to TLE. AC code: 112879774

  2. I removed 1 instance of // from your code and now it doesn't TLE. 112879724

  3. You get an infinite loop on the input

1

9 9 9

In conclusion, you mess up every time.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Unless you see 1000's of people complaining about a strange bug, its most likely you who is messing up.

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

In 2nd problem use int instead of long long, I also got TLE with long long, but int got AC. TLE: 112759305 AC: 112759480