
kuangbin
Strezia
这里介绍不了我
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
kb14数论A ——欧拉函数
A 欧拉函数题意:给出n个数,对于每个数字找到一个欧拉函数值大于等于这个数的数,求找到的所有数的最小和。思路:Euler函数板子,注意N要设的大一点,不能只设成1e6,会RE// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstrin.原创 2021-10-20 00:05:58 · 194 阅读 · 0 评论 -
HDU4027 线段树区间取根号
HDU4027没什么难的注意如果l > r, swap(l, r)// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#include <string>#include <cstdio>#i原创 2021-10-09 13:12:21 · 100 阅读 · 0 评论 -
POJ3264 询问区间最值(不用维护
POJ3264简单板子// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#include <string>#include <cstdio>#include <algorithm>#i原创 2021-10-07 14:15:24 · 132 阅读 · 0 评论 -
ZOJ1610 线段树区间染色 ?
ZOJ1610为什么更新的时候r要-1啊啊啊啊题意:n次操作,每次对[l,r]染颜色d问最后剩几个颜色,如果某个颜色有剩余则输出这个颜色 并输出其有几段// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <c原创 2021-10-07 00:42:04 · 107 阅读 · 0 评论 -
HDU1698 线段树板子 将区间改变为某个数
HDU1698题意:初始n个数每个数为1,每次操作使[l, r]的所有数变为d,求最终的n个数的和线段树的查询和更新一定要注意递归的也是r_change(p, l, r, d) l, r不变spread()中更新子树时它们的长度为子树的长度 不要忘记左移。// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream&原创 2021-10-06 21:42:49 · 212 阅读 · 0 评论 -
POJ2528 线段树离散化** + 染色
POJ2528参考题解// Decline is inevitable,// Romance will last forever.//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#include <string>#include <cstdio>#include <algorithm>#i原创 2021-10-06 19:55:17 · 117 阅读 · 0 评论 -
POJ1984 Navigation Nightmare ——并查集 好题注意细节
注意合并x y集合时的操作:找到根结点fx fy,fa[fx] = fy, 接下来修改fx点的权值,这个值要考虑到点x和y和x y间的关系,具体见代码74-77先存下所有询问,然后离线做POJ1984题意:有多个点,在平面上位于坐标点上,给出一些关系,表示某个点在某个点的正东/西/南/北方向多少距离,然后给出一系列询问,表示在第几个关系给出后询问某两点的曼哈顿距离,或者未知则输出-1。思路:用east数组表示i到父节点需要向东走的距离,nor表示i到父节点需要向北走的距离(负值表示.原创 2021-10-01 21:26:22 · 114 阅读 · 0 评论 -
POJ1733 Parity game ——种类并查集+离散化
POJ1733题意:有n个结点,给出了q个操作,操作是a b string表示结点a到结点b的和是奇数或偶数,输出x(前x个操作都是正确的)。思路原创 2021-10-01 18:57:46 · 181 阅读 · 0 评论 -
POJ1456 Supermarket ——并查集 + 贪心 ?
POJ1456// Decline is inevitable,// Romance will last forever.// POJ1417//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#include <string>#include <cstdio>#include <algorithm原创 2021-10-01 18:03:30 · 146 阅读 · 0 评论 -
POJ1182 食物链 ——并查集** 经典题目
POJ1182POJ-1182 食物链_飘过的小牛-CSDN博客注意find函数的temp// Decline is inevitable,// Romance will last forever.// POJ1182//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#include <string>原创 2021-10-01 14:22:11 · 132 阅读 · 0 评论 -
POJ1611 The Suspects ——并查集
POJ1611题意:有n个人,编号0-n-1,给出m个集合,问一共有多少个人和0号在一个集合。思路:直接并查集即可// Decline is inevitable,// Romance will last forever.// POJ1611//#include <bits/stdc++.h>#include <iostream>#include <cmath>#include <cstring>#inclu.原创 2021-10-01 12:26:55 · 161 阅读 · 0 评论 -
POJ2236 Wireless Network ——并查集
POJ2236原创 2021-10-01 12:08:45 · 119 阅读 · 0 评论