Codeforces 🎨 CF2179H. Blackslex and Plants
利用 lowbit 性質將 x·lowbit(x) 拆解為 log N 個週期性等差數列,結合步長 2^k 的差分陣列進行區間修改,最終以多層前綴和還原答案。
Codeforces 🎨 CF2179G. Blackslex and Penguin Migration
利用 Manhattan Distance 特性,透過三次全圖查詢確定兩個角點與其餘點的距離,進而利用幾何關係解出所有企鵝的座標。
Codeforces 🎨 CF2179F. Blackslex and Another RGB Walking
利用 BFS 依 d % 3 染色,結合二分圖性質,唯一識別父節點方向。
Codeforces 🟣 CF2173F. Isla's Memory Thresholds
Problem solving record for Codeforces 2173F. Isla's Memory Thresholds.
Codeforces 🔵 CF2173E. Shiro's Mirror Duel
Problem solving record for Codeforces 2173E. Shiro's Mirror Duel.
Codeforces 🟢 CF2173D. Taiga's Carry Chains
Problem solving record for Codeforces 2173E. Shiro's Mirror Duel.
Codeforces 🔵 CF367E. Sereja and Intervals
將互不包含區間轉成左右端點序列匹配,掃描值域並用已放左、右端點數做 DP。
Codeforces 🔵 CF466D. Increase Sequence
將每個位置需要補的高度視為區間覆蓋次數,用相鄰覆蓋數變化或開閉區間 DP 計算方案數。
Codeforces 🟣 CF626F. Group Projects
Open and Close Interval Trick 模板題。轉換貢獻計算方式,並用已經開啟的組數來定義 DP 狀態和做狀態轉移。
Codeforces 🟣 CF2109C. Hacking Numbers (Easy/Medium/Hard Version)
存在未知整數 x,透過 add/mul/div/digit 四種操作將其變成目標 n。Hard 版本要求最優操作次數 f(n),關鍵在於利用 digit sum 的數學性質,僅需 3 次操作即可將任意 x 轉換為常數 81。
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.
Codeforces Round 913 (Div. 3) A - F (G待補)
又是賽後補題的一天,pB 用 python 吃了 TLE,用 c++ 才 AC 、pC 被題目騙麻了、pD 想到二分但沒想到可以用區間做。要難受的事情太多了,那就來補題吧。
Codeforces Round 912 (Div. 2) A - C
Codeforces Round 912 (Div. 2) A - C pB思路沒錯,結果計算時的條件判斷沒寫好,rejudge後WA了,難受。但不管如何,人菜就是要多補題。 All problems solved by python A - Halloumi Boxes (CF1903 A) 題意 給出一個長度為 nnn 的Array aaa,每次可以選擇一個長度最多為 aaa 的子陣列進行反轉,問是否能夠使aaa排序成非降序。 思路:Bubble Sort 對於 k≥2k \geq 2k≥2 的情況,我們可以模擬Bubble Sort的過程,故只要 k≥2k \geq2k≥2 就一定可以使 aaa 排序成非降序。 對於 k=1k = 1k=1 的情況,則無法做排序,故只要 $a $中存在 ai−1>aia_{i-1} > a_iai−1>ai 的情況,就無法使 aaa 排序成非降序。 12345678910111213141516171819T = int(input())def check(A): # A是否為升序 for i...
















