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

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

Why did this code time out during contest. I cannot figure it out. If someone can please help on this ? http://codeforces.com/contest/567/submission/12374052

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

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

I may be wrong, but the while loops that count the number of boats that can fit after each of Bob's moves TLE the program. There isn't anything wrong with the set. I did a similar thing on the contest, but I checked the number of boats that can fit in O(1) time. Here's my submission: 12370417

»
9 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

It may be the case. But I highly doubt it because according to me it will run a constant number of times and in most cases as far as I can think, atmost twice.