原创 課前presentation

Link

原创 【CF1553E】Permutation Shift

題目描述 An identity permutation of length \(n\) is an array \([1,2,3,\cdots,n]\). We performed the following operations to

原创 [Vani有約會]雨天的尾巴 - 線段樹合併

題目描述 首先村落裏的一共有 \(n\) 座房屋,並形成一個樹狀結構。然後救濟糧分 \(m\) 次發放,每次選擇兩個房屋 \((x,~y)\),然後對於 \(x\) 到 \(y\)的路徑上(含 \(x\) 和 \(y\))每座房子裏發放一袋

原创 【自適應辛普森】積分計算

Simpson 公式 \[\int_l^rf(x)dx\approx \frac{r-l}{6}[f(l)+4f(\frac{l+r}{2})+f(r)] \]Simpson 公式將 \((l,f(l)),(r,f(r)),(\frac{l

原创 【CF1553F】Pairwise Modulo - 樹狀數組

題目描述 You have an array \(a\) consisting of \(n\) distinct positive integers, numbered from \(1\) to \(n\) . Define \(p_k

原创 調和級數的複雜度

for (int i = 1;i <= n;i++) for (int j = 1;j <= n/i;j++) ... 是調和級數級別的複雜度,可以由調和級數近似求和公式得到 \(T(n)=n\sum_{i=1}^n \frac{1}{

原创 CF 1600-1900 的思維題

CF1545B AquaMoon and Chess 題意     給定 \(n(n\le 10^5)\) 個格子,有些格子上方有棋子,若第 \(i\) 格和第 \(i-1\) 格有棋子,且 \(i-2\) 格無棋子,第 \(i\) 格的棋

原创 【NOIP2020】移球遊戲 - 分治

題目描述 小 C 正在玩一個移球遊戲,他面前有 \(n+1\) 根柱子,柱子從 \(1 \sim n + 1\) 編號,其中 \(1\) 號柱子、\(2\) 號柱子、……、\(n\) 號柱子上各有 \(m\) 個球,它們自底向上放置在柱子上

原创 【CF241E】Flights - 差分約束

題目描述 LiLand is a country, consisting of \(n\) cities. The cities are numbered from \(1\) to \(n\) . The country is well

原创 【CF338E】Optimize! - 線段樹

題目描述 Manao came up with a solution that produces the correct answers but is too slow. You are given the pseudocode of hi

原创 差分約束學習筆記

差分約束可以求出這樣的不等式組的 \(\{x_i\}\) 的一組整數解 \[x_{a_1}-x_{b_1} \le c_1\\ x_{a_2}-x_{b_2} \le c_2\\ \vdots\\ x_{a_n}-x_{b_n} \le c

原创 【CF266E】More Queries to Array... - 線段樹

題目描述 You've got an array, consisting of nn integers: \(a_{1},a_{2},...,a_{n}\). Your task is to quickly run the queries

原创 【CF238C】World Eater Brothers - 樹形 DP

題目描述 You must have heard of the two brothers dreaming of ruling the world. With all their previous plans failed, this ti

原创 【CF316E3】Summer Homework - 線段樹

題目描述 By the age of three Smart Beaver mastered all arithmetic operations and got this summer homework from the amazed te

原创 【CF243C】Colorado Potato Beetle - 離散化+搜索

題目描述 Old MacDonald has a farm and a large potato field, \((10^{10}+1)×(10^{10}+1)\) square meters in size. The field is