上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 43 下一页
摘要: AtCoder Beginner Contest 139 Task F "Engines" 题目大意 给定 $n$ 个二维向量,从中选出若干个,使得它们的和的模最大。 分析 这是一个经典问题,还有一种提法是: 给定 $n$ 个二维向量 $v_1, v_2, \dots, v_n$,求一组系数 $a_ 阅读全文
posted @ 2019-09-17 18:55 Pat 阅读(298) 评论(0) 推荐(0)
摘要: 题目大意 有 $n$ 个不同的糖果,从 $1$ 到 $n$ 编号。有 $k$ 个客人。要用糖果招待客人。 对于每个客人,这些糖果中恰有两个是其最爱。第 $i$ 个客人最爱的糖果编号是 $x_i$ 和 $y_i$ 。 将 $k$ 个客人任意排列,他们按顺序去拿自己最爱的糖果。 客人要拿到至少一个最爱的 阅读全文
posted @ 2019-09-16 23:36 Pat 阅读(378) 评论(0) 推荐(1)
摘要: 给定 $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 阅读全文
posted @ 2019-09-16 02:40 Pat 阅读(397) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-09-13 23:48 Pat 阅读(204) 评论(0) 推荐(0)
摘要: Kick Start 2019 Round E "Code Eat Switcher" 贪心、排序 阅读全文
posted @ 2019-09-11 09:31 Pat 阅读(141) 评论(0) 推荐(0)
摘要: Nmap 版本 症状: 相关信息: https://github.com/nmap/nmap/issues/550 阅读全文
posted @ 2019-09-11 00:30 Pat 阅读(2248) 评论(3) 推荐(0)
摘要: Problem binding to interface , errno: 92 socket_bindtodevice: Protocol not available Problem binding to interface , errno: 92 socket_bindtodevice: Pro 阅读全文
posted @ 2019-09-10 10:22 Pat 阅读(2646) 评论(0) 推荐(0)
摘要: 题目大意 求 $\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( 阅读全文
posted @ 2019-09-09 11:53 Pat 阅读(208) 评论(0) 推荐(0)
摘要: "题目链接" 分析 异或运算满足「三角不等式」。 $\forall a, b, c \in \mathbb{Z}\_{\ge 0}$,有 $a \xor b \le (a \xor c) + (c \xor b)$ 。 证明:容易证明:$\forall a, b \in \mathbb{Z}_{\g 阅读全文
posted @ 2019-08-25 17:29 Pat 阅读(147) 评论(0) 推荐(0)
摘要: X or What? 符号约定: $\xor$ 表示异或。 popcount($x$) 表示非负整数 $x$ 的二进制表示里数字 1 出现的次数。例如,$13 = 1101_2$,则 popcount(13) = 4。 注意到,popcount($a \xor b$) = popcount($a$) 阅读全文
posted @ 2019-07-28 17:38 Pat 阅读(377) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 43 下一页