[心得] C/C++/Delphi/FPC/Java stdin/stdout 速度

看板Programming作者 (張昱珩)時間13年前 (2012/09/13 12:53), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/1
從 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

09/13 13:25, , 1F
cin/cout 要快不難,tie,sync_with_stdio
09/13 13:25, 1F
感謝

09/16 01:01, , 2F
你打算用這個心得做什麼!?
09/16 01:01, 2F

09/16 13:10, , 3F
比賽會用到
09/16 13:10, 3F
※ 編輯: changyuheng 來自: 36.224.168.148 (09/24 23:57)
文章代碼(AID): #1GKMQoML (Programming)
文章代碼(AID): #1GKMQoML (Programming)