AtCoder 🌈 AWC0022D Simultaneous Control of Light Bulb Panels
從左到右貪心處理燈泡狀態,遇到暗燈即翻轉長度 K 的區間,並用差分陣列維護翻轉奇偶性以線性判斷最少操作數。
最新文章
標籤
AlgoCodeforcesPythonAtCoderAtCoder Beginner ContestABC模擬(Simulation)狀態壓縮計數(Counter)前綴和(Prefix Sum)貢獻法縮點有序容器(Sorted Container)C++模運算(Modular Arithmetic)雜湊表(Hash Table)回溯(Backtracking)DFSBFS樹狀陣列(Binary Indexed Tree)逆序對(Inverse Pair)樹(Tree)計數(Counting)分組循環迭代(Iteration)遞迴(Recursion)字串(String)併查集(Disjoint Set Union)博弈論(Game Theory)動態規劃(Dynamic Programming)
網站資訊
文章數量 :
449
總字數 :
649.1k
最後更新時間 :




