LeetCode 🟡 3202. Find the Maximum Length of Valid Subsequence II
Problem solving record for LeetCode 3202. Find the Maximum Length of Valid Subsequence II.
LeetCode Biweekly Contest 154 解題紀錄
Problem solving record for LeetCode Biweekly Contest 154. Rank 169.
Luogu 🟢 P2627 [USACO11OPEN] Mowing the Lawn G
本題是單調佇列優化 DP 的經典題。要求在一排奶牛中選擇若干隻,使得沒有連續超過 K 隻奶牛被選擇,且總效率最大。可透過前綴和與單調佇列在 O(N) 時間內求解。
Codeforces 🟡 CF1791F. Range Update Point Query
Problem solving record for Codeforces 1791F. Range Update Point Query.
Codeforces 🟡 CF2074C. XOR and Triangle
Problem solving record for Codeforces 2074C. XOR and Triangle.
Codeforces 🔵 CF83B. Doctor
Problem solving record for Codeforces 83B. Doctor.
LeetCode 🟡 368. Largest Divisible Subset
Problem solving record for LeetCode 368. Largest Divisible Subset.
LeetCode 🟡 2874. Maximum Value of an Ordered Triplet II
Problem solving record for LeetCode 2874. Maximum Value of an Ordered Triplet II.
LeetCode 2025/04 每日一題 (April LeetCoding Challenge) 目錄
A collection of LeetCode 2025/04 daily challenge.
AtCoder 🔵 AISING2020E Camel Train
有 N 隻駱駝排成一列,若在前 K_i 個位置則幸福值為 L_i,否則為 R_i。透過交換論證將駱駝分為偏好前方與偏好後方兩組,再以反悔貪心(最小堆積)決定選取哪些差值,最大化總幸福值。
LeetCode 🔴 2127. Maximum Employees to Be Invited to a Meeting
Problem solving record for LeetCode 2127. Maximum Employees to Be Invited to a Meeting.
AtCoder 🔵 ABC389F Rated Range
有 N 場比賽,rating 在 [L_i, R_i] 內則 +1。Q 筆查詢初始 rating X 的最終值。利用 f(j) 的單調性搭配懶標記線段樹做區間加法與二分定位,O((N+Q) log X)。
AtCoder Beginner Contest 389 解題紀錄 (A - F)
Problem solving record for AtCoder Beginner Contest 389.
AtCoder 🟡 ABC389D Squares in Circle
計算有多少個單位正方形能完全落在半徑 R 的圓內,利用對稱性與雙指標的單調性在 O(R) 時間內求解。
Luogu 🔵 P4053 [JSOI2007] 建筑抢修
按截止時間排序後,用最大堆維護已選任務;遇到無法容納時,反悔淘汰耗時最長的任務。經典反悔貪心模板題。



![Luogu 🟢 P2627 [USACO11OPEN] Mowing the Lawn G](https://i.gdst.dev/works/846172612737479668.webp)










