原创 3月之從零開始的ACM

2020.3 3.19 學習ST表,處理區間求最值。 對於f[i][j]爲從i開始的2^j個數中的最值,那麼終點爲i + 2^j -1,區間長度爲2^j 。 對於一個區間[l,r],首先求出區間長度k=log2(r-l+1) 。

原创 Codeforces 721 C. Journey(拓撲排序+DP)

codeforces每日一練。 題意: 給定n個點,m條有向邊,以及k時間。求不超過k時間1-n最多能經過多少個點。 思路: 數據<=5000,說明是個暴力dp。 那麼可以用dp[i][j]維護從1到i點經過了j個點,然後初始化

原创 Codeforces D1/D2. Prefix-Suffix Palindrome (Manacher) /詳解

D1. Prefix-Suffix Palindrome (Easy version) D2. Prefix-Suffix Palindrome (Hard version) 題意: 對於給出的字符串,可截取其前綴和後綴,求能組成

原创 Codeforces 626 D. Jerry's Protest(概率DP)

codeforces每日一練。 題意: 有n張卡片,卡片上的數字就是分數,比如說甲乙兩人抽卡,三局兩勝,一局得分高的勝,求在甲贏了兩局的情況下乙贏了第三局且總分比甲高的概率。 思路: 數據1e3,很明顯的On^2算法,所以考慮暴

原创 Codeforces 1325 C. Ehab and Path-etic MEXs (思維) /詳解

C. Ehab and Path-etic MEXs time limit per test1 second memory limit per test256 megabytes inputstandard input outpu

原创 Codeforces 988 D. Points and Powers of Two(數學+結論)

codeforces每日一題。 題意: 給出一個數組,讓你挑選出能組成任意pair<u,v>差值爲2的冪的序列,並且使這個序列長度儘可能大。 思路: 針對於挑選出來的序列,任意pair對<u,v>的差值爲2的冪數。 假設有多個p

原创 Codeforces 1083 A. The Fair Nut and the Best Path(樹形DP)

codeforces每日一練。 題意: 給一棵樹,每個點有一個點權,每條邊有一個邊權,求一條鏈使得點權和-邊權和最大。 思路: 由於我沒看清楚題意,以爲是求聯通子圖的點權和-邊權和最大,用link-cut-tree寫換根,wa1

原创 Codeforces 1325 D. Ehab the Xorcist (思維/構造) /詳解

D. Ehab the Xorcist time limit per test1 second memory limit per test256 megabytes inputstandard input outputstanda

原创 Invalid content was found starting with element 'property'

applicationContext.xml裏報錯 Invalid content was found starting with element ‘property’ 檢查後發現沒有將property放在裏

原创 Codeforces 1324 F. Maximum White Subtree (樹形dp) /詳解

F. Maximum White Subtree time limit per test2 seconds memory limit per test256 megabytes inputstandard input output

原创 Codeforces 1312 E. Array Shrinking (區間dp)

E. Array Shrinking time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstanda

原创 CodeCraft-20 (Div. 2) D. Nash Matrix /詳解

D. Nash Matrix time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o

原创 Ozon Tech Challenge 2020 (Div.1 + Div.2)D. Kuroni and the Celebration

D. Kuroni and the Celebration time limit per test1 second memory limit per test256 megabytes inputstandard input ou

原创 Ozon Tech Challenge 2020 (Div.1 + Div.2)C. Kuroni and Impossible Calculation

C. Kuroni and Impossible Calculation time limit per test1 second memory limit per test256 megabytes inputstandard i

原创 Codeforces Round #625 (Div. 2) D. Navigation System /詳解

D. Navigation System time limit per test2 seconds memory limit per test512 megabytes inputstandard input outputstan