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

Автор JigolKa, история, 15 месяцев назад, По-английски

Hello,

I don't understand why my solution got a TLE for problem B. Here is the solution I came up with during the contest: 299645061. I'm quite sure the complexity is O(nlogn) but maybe I'm wrong. Here is another solution that doesn't use del: 299814673 even though if I remember correctly the complexity of del is O(1).

Does anyone have similar results?

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

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

You got hacked due to hash collisions blowing up your map/dictionary (which Counter is basically). See this blog.

Best way I found of fixing this was to just use str(yourInt) as the keys.

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

quit python learn c++ = no more headache