摘要: description: Two strings \(a,b\) are nonempty strings.We can replace a char, delete a char or add a char, so how many edition are needed to make the t 阅读全文
posted @ 2021-02-26 16:10 _dwt 阅读(37) 评论(0) 推荐(0)
摘要: Link:https://codeforces.com/problemset/problem/1487/E description: \(4\) kinds of dishes, each has \(n_i\) courses for \(i\in \{1,2,3,4\}\), we have t 阅读全文
posted @ 2021-02-25 18:49 _dwt 阅读(52) 评论(0) 推荐(0)
摘要: description: How many pairs \(<a,b>\), s.t. \(a\mod b=\lfloor\frac{a}{b}\rfloor\), for \(1\leqslant a\leqslant x\), $1\leqslant b\leqslant y $ ? solut 阅读全文
posted @ 2021-02-24 00:30 _dwt 阅读(37) 评论(0) 推荐(0)
摘要: Link:https://codeforces.com/problemset/problem/1490/E description: There are \(n\) players, every player has a power value. Every round, two players a 阅读全文
posted @ 2021-02-23 17:26 _dwt 阅读(48) 评论(0) 推荐(0)
摘要: Link:https://www.luogu.com.cn/problem/P3368 description: 实现一个支持动态区间修改(区间内的每个数增加常量), 和单点查询的数据结构. solution: Consider the difference, let \(a[0] = 0\), \ 阅读全文
posted @ 2021-02-23 11:14 _dwt 阅读(42) 评论(0) 推荐(0)
摘要: Link:https://codeforces.com/problemset/problem/1487/D description: Find the numbers of triples$(a,b,c)$s.t.$a2+b2=c^2$and \(a^2=b+c\), where 1≤a≤b≤c≤n 阅读全文
posted @ 2021-02-22 16:16 _dwt 阅读(36) 评论(0) 推荐(0)
摘要: Link: https://codeforces.com/problemset/problem/1487/B description: Cat A sleep from \(n\) downto 1 per hour, while cat B sleep from 1 to n per hour i 阅读全文
posted @ 2021-02-22 09:48 _dwt 阅读(55) 评论(0) 推荐(0)
摘要: n阶$Farey Sequence$是 [0,1]间 分母不超过n的有理数的升序排列. 相关数学证明: \(\frac{m}{n}<\frac{m+m'}{n+n'}<\frac{m'}{n'}\) 初始, 令$\frac{0}{1} = \frac$, \(\frac{1}{1} = \frac{ 阅读全文
posted @ 2021-02-20 16:48 _dwt 阅读(66) 评论(0) 推荐(0)
摘要: Trie树可以看做一种确定有限状态自动机(Deterministic Finit Automata) \((S, \Sigma,K,F, \delta )\) $其中, \ S是状态集(Trie树上所有的节点), \ \Sigma 是字母表{a,b,c,...,z}, \ K是起始状态(只有root 阅读全文
posted @ 2021-02-19 15:09 _dwt 阅读(26) 评论(0) 推荐(0)
摘要: description: 长$L$米,宽$W$米的草坪里装有$n$个浇灌喷头。每个喷头都装在草坪中心线上(离两边各$\frac{2}$米)。我们知道每个喷头的位置(离草坪中心线左端的距离),以及它能覆盖到的浇灌范围。 请问:如果要同时浇灌整块草坪,最少需要打开多少个喷头? solution: 先预处 阅读全文
posted @ 2021-02-19 10:55 _dwt 阅读(40) 评论(0) 推荐(0)