作者changyuheng (張昱珩)
看板Programming
標題[心得] C/C++/Delphi/FPC/Java stdin/stdout 速度
時間Thu Sep 13 12:53:03 2012
從 Codeforces problem 222B www.codeforces.com/problemset/status/222/problem/B
可觀察出,在 Windows x86 上:
C++
scanf 快,
cin 慢;
printf 快,
cout 慢。
FPC
read/writeln 都快過 GNU C 的 scanf/printf,
而 Delphi 又快過 FPC。
Java 6/7
BufferedReader(InputStream(System.in)) 快,
Scanner(System.in) 慢;
BufferedWriter(OutputStream(System.out)) 快,
PrintWriter(System.out) 中,
System.out.println() 慢。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.21.127.209
→ danielguo:cin/cout 要快不難,tie,sync_with_stdio 24.19.233.135 09/13 13:25
感謝
推 qrtt1:你打算用這個心得做什麼!? 114.25.250.137 09/16 01:01
→ changyuheng:比賽會用到 36.224.170.177 09/16 13:10
※ 編輯: changyuheng 來自: 36.224.168.148 (09/24 23:57)