Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Heisenbug's blog

By Heisenbug, history, 9 years ago, In English

In the submission http://mirror.codeforces.com/contest/577/submission/12949782 I first printf "YES" and then I printf some numbers. In the output, the numbers came out first and then the "YES". Documentation for std::ios_base::sync_with_stdio generally seems to indicate that bad effects from disabling it should only occur if you use both C- and C++-style I/O. Here I only used C-style output throughout, yet the print statements were mixed. Is this really an allowed behavior for the library?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +9 Vote: I do not like it

It's still possible for your solution to mix printf and cout e.g. when hub != 0. You printf("YES") and then cout << i << ....

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Oh... missed that one. Thanks.