__Tesseract4's blog

By __Tesseract4, 12 months ago, In English

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.

  • Vote: I like it
  • +33
  • Vote: I do not like it

»
12 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

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

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

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

  • »
    »
    12 months ago, # ^ |
    Rev. 3   Vote: I like it +18 Vote: I do not like it

    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

  • »
    »
    12 months ago, # ^ |
    Rev. 4   Vote: I like it +19 Vote: I do not like it

    Magic.. Thanks for these combinations

    Can relate yes 239808962.

    • »
      »
      »
      12 months ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      But u got accepted with include before pragmas??

      • »
        »
        »
        »
        12 months ago, # ^ |
        Rev. 4   Vote: I like it +10 Vote: I do not like it

        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.

»
12 months ago, # |
  Vote: I like it +18 Vote: I do not like it

See 896E and the author's editorial.

»
12 months ago, # |
  Vote: I like it +18 Vote: I do not like it

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

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

well-know things, downvoted