As a competitive programmer, I've always used
ios::sync_with_stdio(0); to speed up
cout. But I've also seen other people use optimizations like
cout.sync_with_stdio(0);. For example, the latter two were used in this website: https://usaco.guide/general/fast-io?lang=cpp.
I know that
printf), so why would someone unsync only the input
cin or only the output
cout when doing competitive programming (which usually has a large amount of both input and output)?
sync_with_stdio is a static method,
cin.sync_with_stdio(0) does "exactly" the same as
Not really exactly as it odr-uses
std::cin but it is no-op.