精華區beta Marginalman 關於我們 聯絡資訊
遭遇了前所未有的苦戰 幹== 好想跳出去當風箏 def maxEvents(self, events: List[List[int]]) -> int: pq = [] events.sort() idx, ans = 0, 0 for i in range(100001): while idx<len(events) and events[idx][0]<=i: heappush(pq, events[idx][1]) idx += 1 while pq and pq[0]<i: heappop(pq) if pq: heappop(pq) ans += 1 return ans -- https://i.imgur.com/wRnmv7s.jpeg https://i.imgur.com/mceoqQj.jpeg -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.58.28 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1751867153.A.980.html ※ 編輯: DJYOSHITAKA (220.132.58.28 臺灣), 07/07/2025 13:47:27