精華區beta Marginalman 關於我們 聯絡資訊
用C++寫 結果遇上測資是 "111111111111111111111111111111111111111111111" 時 出現了 Time Limit Exceeded https://i.imgur.com/qIr2iFz.png 有哪一部分語法或邏輯可以改進的嗎 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.25.103.31 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1664642307.A.F7D.html
Pash97143: 一開始比較短的測資都還能過 10/02 00:39
SecondRun: 題目是啥 10/02 00:42
Pash97143: 每日的 10/02 00:44
Pash97143: https://i.imgur.com/NLNxrj2.jpg 10/02 00:45
Apache: DP 10/02 00:45
fxfxxxfxx: 你這複雜度會爆 應該會變exponential 10/02 00:46
Apache: 上一篇不就解法 10/02 00:46
fxfxxxfxx: "111111" 答案就會是費波那器 10/02 00:47