09 2019 档案
摘要:"题目链接" 题目大意 有 $N$ 个人,$S$ 项技能,这些技能用 $1, 2, 3, \dots, S$ 表示 。第 $i$ 个人会 $c_i$ 项技能($ 1 \le c_i \le 5 $)。对于两个人 $i$, $j$,若 $i$ 会某项技能而 $j$ 不会,则称 $i$ 可以辅导 $j$
阅读全文
摘要:题目大意 给定一个 $N$ 个点 $M$ 条边的有向图 $G$,无重边、自环。找出图 $G$ 的一个 导出子图 (induced subgraph) $G'$,且 $G'$ 中的每个点的入度和出度都是 1。 数据范围 $ 1 \le N \le 1000$ $ 0 \le M \le 2000$ 分
阅读全文
摘要:"题目链接" 这道题的要点是状态转移的顺序。 要从低位向高位进行状态转移。 Implementation cpp string s; cin s; reverse(all(s)); int x, y; scan(x, y); int n = (int) s.size(); vector dp(n,
阅读全文
摘要:新建一个本地分支,将一个远程分支 checkout 到新建的那个本地分支。 注意:`` 必须是新的本地分支,不能和已有的本地分支同名。 如果你指定的 相同,则可简写为 其中 可简写为 。 git push Local branch 'master' set up to track remote br
阅读全文
摘要:"题目链接" Implementation c++ int n, q; scan(n,q); vi p(n + 1); vi nson(n + 1); up (i, 1, n) { scan(p[i]); nson[p[i]]++; } vi leaf; up (i, 1, n) { if (nso
阅读全文
摘要:Intel Driver and Support Assistant 以下简称 Intel DSA。 Intel DSA 依赖 Microsoft Visual C++ 2015 2019 Redistributable (x86),以下简称 vc_redist.x86。 我电脑上安装的 cv_re
阅读全文
摘要:Problem Check if a positive integer $n$ can be written as sum of a positive integer and reverse of that integer. Here, reverse of a positive integer i
阅读全文
摘要:如题。 可持久化线段树。
阅读全文
摘要:Fisher Yates shuffle Durstenfeld's in place version 现在问题是如何给随机数引擎 一个种子(seed)。常见的办法是用系统时间: 或者 。但是这种方法有争议,见 https://stackoverflow.com/q/36663027/6052725
阅读全文
摘要:AtCoder Beginner Contest 139 Task F "Engines" 题目大意 给定 $n$ 个二维向量,从中选出若干个,使得它们的和的模最大。 分析 这是一个经典问题,还有一种提法是: 给定 $n$ 个二维向量 $v_1, v_2, \dots, v_n$,求一组系数 $a_
阅读全文
摘要:题目大意 有 $n$ 个不同的糖果,从 $1$ 到 $n$ 编号。有 $k$ 个客人。要用糖果招待客人。 对于每个客人,这些糖果中恰有两个是其最爱。第 $i$ 个客人最爱的糖果编号是 $x_i$ 和 $y_i$ 。 将 $k$ 个客人任意排列,他们按顺序去拿自己最爱的糖果。 客人要拿到至少一个最爱的
阅读全文
摘要:给定 $n$ 个两两不同的正整数 $a_1, a_2, \dots, a_n$,$a_i Let the length of a number be the number of digits needed to write it out in binary, excluding any leadin
阅读全文
摘要:C++ Primer 5th edition, chapter 13. The Rule of Three If a class needs a destructor, it almost surely needs a copy constructor and copy assignment ope
阅读全文
摘要:Kick Start 2019 Round E "Code Eat Switcher" 贪心、排序
阅读全文
摘要:Nmap 版本 症状: 相关信息: https://github.com/nmap/nmap/issues/550
阅读全文
摘要:Problem binding to interface , errno: 92 socket_bindtodevice: Protocol not available Problem binding to interface , errno: 92 socket_bindtodevice: Pro
阅读全文
摘要:题目大意 求 $\sum_{i = 1}^{n} \sum_{j = 1}^{m} \mu(\lcm(i, j))$ 。 $ 1 \le n, m \le 10^6 $ 。 分析 不妨设 $ n \le m$ 。 $ \mu(\lcm(i, j)) = \mu(i) \mu(j) \mu(\gcd(
阅读全文