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

Автор Qualified, история, 4 года назад, По-английски

I see people using "ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);" I personally use "ios::sync_with_stdio(0); cin.tie(0);" without the "cout.tie(0);". What is the difference? Is the first option faster than the second?

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

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

cout is not tied to anything by default. So, cout.tie(false) is useless.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Then why do people still use it?

    • »
      »
      »
      4 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +23 Проголосовать: не нравится

      Because they saw it from another person who also doesn't know that it's useless, and they keep using it without noticing because it does nothing — not even any trouble.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        Oh, I get it, they are just using it because other mindless blokes are using it too.