[問題] ACM 458 runtime error

看板C_and_CPP作者 (Silence)時間10年前 (2013/12/20 18:59), 編輯推噓1(103)
留言4則, 4人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) 在Linux上寫, gcc編譯 問題(Question): 不知道為什麼uva online會回傳runtime error? has failed with verdict Runtime error. This means that the execution of your program didn't finish properly. Remember to always terminate your code with the exit code 0. 餵入的資料(Input): 1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5 1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5 1KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5* 預期的正確結果(Expected Output): *CDC is the trademark of the Control Data Corporation. *IBM is a trademark of the International Business Machine Corporation. *DEC is the trademark of the Digital Equipment Corporation. 錯誤結果(Wrong Output): 自己輸入sample的input沒有問題..但是uva那邊給我runtime error 程式碼(Code):(請善用置底文網頁, 記得排版) http://ideone.com/ps0aYk 補充說明(Supplement): 不知道為什麼會runtime error?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.36.49.111

12/20 20:16, , 1F
你覺得餵 100KB 的資料量給你的程式會怎樣?
12/20 20:16, 1F

12/20 20:17, , 2F
input_buffer爆了。UV那有些testcases很大包。
12/20 20:17, 2F

12/20 20:26, , 3F
了解…感謝!
12/20 20:26, 3F

12/21 01:46, , 4F
這題不用設 buffer 就能解啦 @@
12/21 01:46, 4F
文章代碼(AID): #1Ij2CIBH (C_and_CPP)