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.
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
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
Magic.. Thanks for these combinations
Can relate yes 239808962.
But u got accepted with include before pragmas??
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.
See 896E and the author's editorial.
Noted. Thanks
Actually I think D is a nice problem.Very strange but also beautiful.
well-know things, downvoted