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

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

I don't get how pragma optimizations move a solution with same time complexity from 4 sec to 1092 ms ?! It is today's H1 ! I wouldn't have accept anyways because I had a printing bug ..

But how same time complexity result in 4 sec and 1 sec running times!! Only due to pragmas

Also some comments: I think the round was horrible, unfair and H1, H2 were OEISable, A-B pretests were too weak. D was a too weird adhoc.

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

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

If you first use include then pragma it does not work I don't know why

first pragma then include (tle): https://codeforces.com/contest/1916/submission/239806977

first include then pragma (ac): https://codeforces.com/contest/1916/submission/239742895

  • »
    »
    5 месяцев назад, # ^ |
    Rev. 3   Проголосовать: нравится +18 Проголосовать: не нравится

    I have tried some combinations and here are some of the the results:

    O3 + avx2: tle

    0fast + avx2: 1154 ms

    optimize("Ofast,inline,unroll-loops,fast-math") + target("avx2,bmi,bmi2,lzcnt,popcnt,sse,sse2,sse3,sse4,mmx"): 951 ms

  • »
    »
    5 месяцев назад, # ^ |
    Rev. 4   Проголосовать: нравится +19 Проголосовать: не нравится

    Magic.. Thanks for these combinations

    Can relate yes 239808962.

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

      But u got accepted with include before pragmas??

      • »
        »
        »
        »
        5 месяцев назад, # ^ |
        Rev. 4   Проголосовать: нравится +10 Проголосовать: не нравится

        Yeah. upvoted. Excuse me, it was late night .. #include before pragmas is the correct, the other way around (pragma before #include bits) TL..

        It got me once TL because there had been additional memory allocation declaring a vector of strings in that specific case of #include before pragmas.

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

See 896E and the author's editorial.

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

Actually I think D is a nice problem.Very strange but also beautiful.

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

well-know things, downvoted