作者fxfxxxfxx (愛麗絲)
看板Marginalman
標題[閒聊] LeetCode Weekly Contest 326
時間Sun Jan 1 12:00:09 2023
哭了 這禮拜一題 hard 都沒有
阿我打字就很慢阿 爛死了
https://i.imgur.com/VEQUBRJ.png
22:46 排 344 名 :((((
1. Count the Digits That Divide a Number
對每個 digit 檢查
2. Distinct Prime Factors of Product of Array
對每個 <= 1000 的質數檢查 nums 內有沒有人被他整除
<= 1000 的質數只有 168 個,時間還是綽綽有餘
3. Partition String Into Substrings With Values at Most K
DP[i] = min_j(DP[i-j] + 1) 對所有 int(s[i-j:i+1]) >= k
因為 k <= 10^9,長度最多 10,時間很夠
4. Closest Prime Numbers in Range
直接檢查 [left, right] 內相鄰的質數找距離最短的
慘
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.16.175 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1672545611.A.36A.html
推 SecondRun: 大師 01/01 12:04
推 NTHUlagka: 大師 01/01 12:43