摘要: 一、赛题 ~~水题不解释~~ 加强/推广至一般情况 (某些知识的)模板/经典题 1.NOIP提高组 年份 Day A B C Day A B C 2016 D1 玩具谜题 天天爱跑步 换教室 D2 组合数问题 蚯蚓 愤怒的小鸟 2015 D1 神奇的幻方 信息传递 斗地主 D2 跳石头 字串 运输计 阅读全文
posted @ 2017-08-04 21:14 Planet6174 阅读(841) 评论(0) 推荐(0) 编辑
摘要: 树形背包 有 $N$ 个物品,编号分别为 $1\ldots N$。物品 $i$ 的重量为 $w_i$,价值为 $v_i$。 给出每个物品依赖于哪个物品。我们用 $d_i = j$ $(i j 0)$ 表示:如果要选取物品 $i$,就必须先选取物品 $j$。另外,我们用 $d_i = 0$ $(i 0 阅读全文
posted @ 2019-02-19 17:48 Planet6174 阅读(365) 评论(0) 推荐(0) 编辑
摘要: "http://codeforces.com/blog/entry/8219" 凸包优化 1(Convex Hull Optimization 1) 对于形如 $ dp[i] = \displaystyle\min_{1\le j 阅读全文
posted @ 2018-05-03 14:03 Planet6174 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 返回二进制表示中 的最后一位 $1$(最右边的)是从后向前第几位,比如 $7368(1110011001000)$ 返回 $4$ 。 返回二进制表示中前导 $0$ 的个数。 返回二进制表示中末尾 $0$ 的个数。 返回二进制表示中 $1$ 的个数。 返回 的奇偶校验位,也就是 的 $1$ 的个数模 阅读全文
posted @ 2018-04-09 13:43 Planet6174 阅读(1048) 评论(0) 推荐(0) 编辑
摘要: cpp include include using std::cin; struct Moment { double value; short weight; bool operator n w u v t1 t2; cnt = 0; add_time(t1, 0); add_time(t2, 0) 阅读全文
posted @ 2018-01-11 13:53 Planet6174 阅读(268) 评论(0) 推荐(0) 编辑
摘要: ```BFS``` ```正解就是乱搞系列``` ```cpp #include #include char G[50][50]; bool mk[50][50][10001]; struct QueueNode { int x, y, cur, dist; QueueNode (int x = 0, int y = 0, int cur = 0, int dist = 0): ... 阅读全文
posted @ 2017-12-31 22:52 Planet6174 阅读(240) 评论(0) 推荐(0) 编辑
摘要: cpp include include include int main() { int p, a, b, c, d, n; scanf("%d%d%d%d%d%d", &p, &a, &b, &c, &d, &n); double maxans = p (sin(a + b) + cos(c + 阅读全文
posted @ 2017-12-31 22:50 Planet6174 阅读(214) 评论(0) 推荐(0) 编辑
摘要: cpp include include using std::sort; define kN 1000000 struct vv { int a, b; vv(int a = 0, int b = 0): a(a), b(b) {} }p[kN], q[kN]; bool cmp1(vv xx, v 阅读全文
posted @ 2017-12-31 22:47 Planet6174 阅读(582) 评论(0) 推荐(0) 编辑
摘要: cpp include using std::cin; using std::cout; using std::endl; struct treenode { int val; treenode lc, rc; treenode(int val = 0): val(val), lc(NULL), r 阅读全文
posted @ 2017-12-31 22:46 Planet6174 阅读(431) 评论(0) 推荐(0) 编辑
摘要: cpp include include include int main() { int d, k; std::cin d k; int r[257], p[257]; for (int i = 1; i r[i] p[i]; static long long f[257][257]; memset 阅读全文
posted @ 2017-12-29 12:58 Planet6174 阅读(492) 评论(0) 推荐(0) 编辑
摘要: ``` include include using std::cin; using std::cout; int main() { int n, m; cin n m; bool G[26][26]; while (n ) { char a, b; cin a b; G[a 'a'][b 'a'] 阅读全文
posted @ 2017-12-28 20:58 Planet6174 阅读(298) 评论(0) 推荐(0) 编辑