[OI] problem-solving skills cin, cout slow due to the input and output of TLE

Language itself is no problem! !

Language itself is no problem! !

Language itself is no problem! !

C ++ is the original design of the input standard input output streams and C linked together, thus leading to cin, cout must first place the content into a buffer before the input and output, and finally read by the cin, cout output. This will lead to the rapid decline in efficiency.

So disassociate enough.

In the main () which added two sentences: (must be in the main inside, do not believe in themselves to try)

ios::sync_with_stdio(false);

cin.tie (0);

Get!

Certainly want to switch at any time can be input and output using <bits / stdc ++. H>

PS: Please use carefully before you use OJ research or participate in what the game can not use this header file , or peril.

Guess you like

Origin www.cnblogs.com/nowonder/p/sync_with_stdio.html
Recommended