Блог пользователя Heisenbug

Автор Heisenbug, история, 9 лет назад, По-английски

In the submission http://codeforces.net/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?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Oh... missed that one. Thanks.