Skip to content

iostream Acceleration

Untie

ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

Tip

The untied cin & cout are actually faster than scanf & printf.

Warning

You CANNOT use functions in <stdio> after untie, including printf(), scanf(), puts(), freopen().

endl

endl can be about 10 times slower than the "\n".

#define endl '\n'

Comments