I have two submissions of the same code 169242883 and 169242938 of the problem 812 E one with compiler Visual C++ 17, another with compiler GNU C++ 17.
Visual C++ gives TLE, GNU oks. Looks like sync_with_stdio doesn't work properly in Visual C++. Has anybody faced this problem before?