I used to think printf scanf are faster than cin cout. However in this https://mirror.codeforces.com/contest/914/submission/61405523 i used printf and scanf and got TLE. When i changed it to cin cout and \n I got AC( i used ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) though) https://mirror.codeforces.com/contest/914/submission/61406026. In some cases i found printf scanf to be faster than cin cout( I did not use ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) those times ). Can someone tell me the most efficient way to take I/O
Thanks to Sergey Kopeliovich, try this
http://acm.math.spbu.ru/~sk1/algo/input-output/fread_write_export.cpp.html