Fast IO (ios_base) in C++

Can anyone help me what is significant of this below syntax in c++.
Also I need to know how exactly it works ?

ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);

1 Like

By default synchronisation with the standard c++ is on. This is computationally expensive. Turning it off saves some time during I/O.
Cin.tie(null)
This unties cin from cout . Tied streams ensure that one stream is flushed automatically before each I/O operation on the other stream.

Answers on this page are quite well explained: c++ - Significance of ios_base::sync_with_stdio(false); cin.tie(NULL); - Stack Overflow

2 Likes