Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

Why isn't there TLE?

I was solving the D problem of the previous contest Div2.907
I used binary search, but it needed ridiculous optimizations before it got accepted, and even then, it was a close call.
I played around for a while trying to make it even closer.
After all a while, I noticed....

That, codeforces forgot what TLE is.

As far as I can make out, this is a supreme example of machine learning that in the future, should be of great service to all competitive programmers worldwide.

I made a last attempt at manufacturing a TLE, unfortunately, I failed to get it. It was very disappointing for me. As a competitive programmer, I thought that though I couldn't get AC all the time, at least I could get TLE, if I wanted. Apparently, even this is beyond my ability.

My Entire Program
The solve() function that should create TLE

These are the links to my last attempts
- 230780232 This submission ran till test 17 before TLE occurred, some kind of self-realisation, maybe?!
- 230780567 My next attempt was totally unsuccessful, it got AC, what a pity.

On my local system, things work as normal. I'm currently expecting to see some output after a few decades.

As these violations of the universe are beyond my sphere of comprehension, could any wise sage possibly enlighten me?

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

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

Auto comment: topic has been updated by jmichael (previous revision, new revision, compare).

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

gg

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

NT

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

You may appreciate a read about constant folding in compilers, or a link to try various optimization levels.

  • »
    »
    11 месяцев назад, # ^ |
      Проголосовать: нравится +9 Проголосовать: не нравится

    I see, it converted the iterated increment into a single addition, and then applied other optimizations. Interesting, wasn't aware that compilers did this too.

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

well that's an interesting problem there