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 🔵 CF2109C. Hacking Numbers (Easy/Medium/Hard Version)
Problem solving record for Codeforces 2109C. Hacking Numbers.
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...
Codeforces Round 909 (Div. 3) A - F
Codeforces Round 909 (Div. 3) A - F 補題補題。 All problems solved by python A - Game with Integers (CF1899 A) 題意 兩個人玩遊戲,給定一個數 NNN , 每人能夠對數字進行執行 +1+1+1 或 −1-1−1 的操作,若操作完 NNN 是 333 的倍數則該名玩家獲勝,但若超過10次操作沒有結果,則後手獲勝,問先手的人能否獲勝。 思路 若第一輪先手無法獲勝,則後手必可以將先手的操作抵銷,故先手獲勝的條件是第一次操作就能獲勝,即 N mod 3N \bmod 3Nmod3 餘 111 或 222。 12345678T = int(input())for _ in range(T): N = int(input()) if N % 3 == 0: print("Second") else: print("First") B - 250 Thousand Tons of TNT...

















