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.