[問題] uva11988

看板C_and_CPP (C/C++)作者 (史蒂芬)時間11年前 (2014/07/07 12:30), 11年前編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Dev-C++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) iostream 問題(Question): uva11988 http://ppt.cc/qOge 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): Time limit exceeded 程式碼(Code):(請善用置底文網頁, 記得排版) http://codepad.org/3F4b1wET 補充說明(Supplement): 我知道可以用STL的list... 但是想要複習linked list和OOP 所以這樣打XD 不知道什麼原因都說tle 跪求幫忙! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.169.51.101 ※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1404707420.A.F04.html

07/07 12:45, , 1F
insert_end() 是 O(n), 如果整行都沒有 [ 總複雜度是 O(n^2)
07/07 12:45, 1F

07/07 12:45, , 2F
100,000 個字元 TLE 不意外
07/07 12:45, 2F

07/07 12:49, , 3F
原來如此~~ 謝謝s大!
07/07 12:49, 3F
※ 編輯: g12288 (1.163.185.165), 07/07/2014 23:41:45
文章代碼(AID): #1JkY9Sy4 (C_and_CPP)
文章代碼(AID): #1JkY9Sy4 (C_and_CPP)