[ACM] 11084 && 11127

看板C_and_CPP (C/C++)作者 (~"~)時間14年前 (2011/09/02 20:20), 編輯推噓2(202)
留言4則, 1人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) g++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): TLE 餵入的資料(Input): 題目: 11084 http://luckycat.kshs.kh.edu.tw/homework/q11084.htm 11127 http://luckycat.kshs.kh.edu.tw/homework/q11127.htm 預期的正確結果(Expected Output): ac 錯誤結果(Wrong Output): TLE 程式碼(Code):(請善用置底文網頁, 記得排版) 11084: http://codepad.org/c7XwSbg4 11127: http://codepad.org/KKhUejgD 補充說明(Supplement): 這兩題都沒有什麼特別的想法 直接暴搜 果然都TLE 想請問這兩題該用什麼解法才可以不超時的呢? 上網google 了好一陣子都沒什麼結果... code寫的很醜 只希望強者能指點一下算法^^" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.184.164.153

09/02 21:43, , 1F
第一題排列的做法要不要改一下
09/02 21:43, 1F

09/02 21:44, , 2F
你窮舉出所有排列的部分一直用到set.find()我猜複雜度會
09/02 21:44, 2F

09/02 21:44, , 3F
滿高
09/02 21:44, 3F

09/02 21:50, , 4F
可以去google一下all permutation
09/02 21:50, 4F
文章代碼(AID): #1EOCeS6T (C_and_CPP)
文章代碼(AID): #1EOCeS6T (C_and_CPP)