摘要: 题目描述 An identity permutation of length \(n\) is an array \([1,2,3,\cdots,n]\). We performed the following operations to an identity permutation of len 阅读全文
posted @ 2021-10-05 17:02 lrj124 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 题目描述 首先村落里的一共有 \(n\) 座房屋,并形成一个树状结构。然后救济粮分 \(m\) 次发放,每次选择两个房屋 \((x,~y)\),然后对于 \(x\) 到 $y$的路径上(含 \(x\) 和 \(y\))每座房子里发放一袋 \(z\) 类型的救济粮。 然后深绘里想知道,当所有的救济粮发 阅读全文
posted @ 2021-08-28 16:16 lrj124 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 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+r}{2},f(\frac{l+r}{2}))\) 看作一 阅读全文
posted @ 2021-08-15 11:53 lrj124 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 题目描述 You have an array \(a\) consisting of \(n\) distinct positive integers, numbered from \(1\) to \(n\) . Define \(p_k\) as \(p_k = \sum_{1 \le i, j 阅读全文
posted @ 2021-07-27 15:48 lrj124 阅读(72) 评论(0) 推荐(0) 编辑
摘要: for (int i = 1;i <= n;i++) for (int j = 1;j <= n/i;j++) ... 是调和级数级别的复杂度,可以由调和级数近似求和公式得到 \(T(n)=n\sum_{i=1}^n \frac{1}{n}=O(n \ln n)\) 具体过程如下 $$\begin{ 阅读全文
posted @ 2021-07-25 17:48 lrj124 阅读(561) 评论(0) 推荐(0) 编辑
摘要: 题目描述 小 C 正在玩一个移球游戏,他面前有 \(n+1\) 根柱子,柱子从 \(1 \sim n + 1\) 编号,其中 \(1\) 号柱子、\(2\) 号柱子、……、\(n\) 号柱子上各有 \(m\) 个球,它们自底向上放置在柱子上,\(n + 1\) 号柱子上初始时没有球。这 \(n \t 阅读全文
posted @ 2021-06-22 12:01 lrj124 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 题目描述 LiLand is a country, consisting of \(n\) cities. The cities are numbered from \(1\) to \(n\) . The country is well known because it has a very st 阅读全文
posted @ 2021-02-18 23:16 lrj124 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 差分约束可以求出这样的不等式组的 \(\{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_n\\ \] 对于一个不等式可以移个项 \(x_{a_i 阅读全文
posted @ 2021-02-17 23:18 lrj124 阅读(176) 评论(0) 推荐(1) 编辑
摘要: 题目描述 Manao came up with a solution that produces the correct answers but is too slow. You are given the pseudocode of his solution, where the function 阅读全文
posted @ 2021-02-17 21:19 lrj124 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 题目描述 By the age of three Smart Beaver mastered all arithmetic operations and got this summer homework from the amazed teacher: You are given a sequenc 阅读全文
posted @ 2021-02-02 17:26 lrj124 阅读(70) 评论(0) 推荐(0) 编辑