[Python] 功課好難做 求救

71 回覆
2 Like 21 Dislike
2020-11-18 20:29:30
thank you ching, 明曬 連登唯一好人
2020-11-18 20:30:34
係WO
你啱
傻豬豬左
2020-11-19 14:34:10
btw 樓主呢題 factorial
一個 for loop O(n) 已經搞掂啦
上面用兩個果班
我俾個 n = 1000000 你點行?
2020-11-19 15:21:53
題目幅圖睇唔到?
2020-11-19 16:04:35
Doesn't work if n == 0.

Also this has an unnecessary time complexity of O(n^2) when you can do it in O(n) by simply moving x outside the first loop and append the result of x*i.
2020-11-19 16:23:28
死圖
2020-11-20 19:40:42

主要既嘢得1行
簡簡單單咪得,寫咁複雜做乜

唔跟足樓主功課指引
自己參透下
2020-11-20 19:47:18
算唔算dynamic programming
2020-11-20 19:52:40
應該算係
樓主份功課唔比用?
2020-11-21 18:40:47
其實就係簡單嘅memoization啫
2020-11-22 08:32:23
Recursion
2020-11-22 10:23:24
你朋友應該本身有天份
2020-11-23 06:29:24
當連登係google?
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞