Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Hamroz_JONN's blog

By Hamroz_JONN, history, 2 years ago, In English

First submission with Cin/Cout w/o Sync: 185094688, 3915 ms

Second one with Scanf/Printf: 185094426, 1357 ms

Shouldn't that be exactly the opposite ?

Because almost everywhere its mentioned that Cin/Cout w/o Sync should be faster, or at least same speed as Scanf/Printf.

Why is it so ?

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

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

cin.tie() doesn't do anything useful in your code(it returns a pointer to cout).

cin.tie(0) gives a massive speed increase as it means reading from cin doesn't flush cout.