[問題] ACM11401 (已解決)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
C
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
time limit exceeded
餵入的資料(Input):
5 8 10 100
預期的正確結果(Expected Output):
3 22 50 79625
錯誤結果(Wrong Output):
time limit exceeded
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/fjzdPtmS
補充說明(Supplement):
可以請問板上的神手們為什麼這樣會造成超過時間啊?
要如何修改會比較好呢
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.192.129.162
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1414598913.A.E28.html
→
10/30 02:18, , 1F
10/30 02:18, 1F
→
10/30 10:29, , 2F
10/30 10:29, 2F
→
10/30 12:24, , 3F
10/30 12:24, 3F
→
10/30 12:24, , 4F
10/30 12:24, 4F
→
10/30 12:24, , 5F
10/30 12:24, 5F
→
10/30 12:25, , 6F
10/30 12:25, 6F
推
10/30 12:55, , 7F
10/30 12:55, 7F
抱歉讓各位見笑了...結果這分程式碼沒有TLE 是WA 抱歉了K大 囧"
結果造成WA的原因是main裡面的while條件設錯 把n>4 改成 n>2就可以了
感謝各位的解答!!
※ 編輯: lmd71982 (123.192.129.162), 10/30/2014 19:48:46
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章