Alexey's blog

By Alexey, history, 21 month(s) ago, translation, In English

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?

Upd:: this seems to be an answer. VC++ in fact just sets flag and doesn't break the sync between C and C++ streams, which btw is allowed by the standard.

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

»
21 month(s) ago, # |
  Vote: I like it +10 Vote: I do not like it

Auto comment: topic has been translated by Alexey (original revision, translated revision, compare)

»
21 month(s) ago, # |
  Vote: I like it +28 Vote: I do not like it

It is well-known stuff that sync_with_stdio doesn't work in Visual C++.

  • »
    »
    21 month(s) ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    Hey, thanks for the info! Do you have any idea how make it work in Visual C++?

    • »
      »
      »
      21 month(s) ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      maybe u can use printf, scanf instead, if sync_with_stdio doesn't work?

    • »
      »
      »
      21 month(s) ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Even if this stuff is well-known, I only read it today.

      I think that Visual C++ is simply slower, there might be no way to make it work. Basically sending solutions in Visual C++ makes no sense.