Accelerate C ++ cin, cout speed

With the following two lines of code:

    :: sync_with_stdio iOS ( to false );    // acceleration 
    cin.tie ( 0 );
  1. First SYNC_ WITH_ the stdio (to false) to interrupt the output to the input buffer iostream, can save a lot of time, so that almost the same with scanf.
  2. The stream is a function of two tie binding, if an empty parameter returns the current output pointer, i.e. tie (0) and the tie (nullptr a) cin and cout to solve the binding.

 

Guess you like

Origin www.cnblogs.com/Bella2017/p/11519670.html