본문 바로가기
c++

[C++] 입력 속도, cin속도

by yoonjunho 2023. 3. 2.
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cs

cin cout보다 printf, scanf가 더 빠름

※ endl보다 \n을 사용하는 것이 더 빠름

https://algwang.tistory.com/10

 

C++ cin, cout 입출력 속도 높이기

일반적으로 cin과 cout은 printf, scanf와 비교했을 때 속도가 현저히 느리다. 그냥 사용한다해도 이 차이로 시간초과가 발생하는 경우를 만나보지 못했고 cin과 cout이 훨씬 편하다고 느꼈기 때문에 그

algwang.tistory.com