What is the fastest way to take I/O in c++?

Правка en1, от prabalsingh24, 2019-09-28 10:16:11

I used to think printf scanf are faster than cin cout. However in this https://codeforces.me/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://codeforces.me/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

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский prabalsingh24 2019-09-28 10:16:11 570 Initial revision (published)