![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
一堆瓜子壳
听课还是睡觉,嗯,这个问题向哈姆雷特...
展开
-
POJ1611——The Suspects
标准的并查集应用,需要路径压缩。#include #include #include #include #include using namespace std;const int maxN=30001;int fa[maxN],rank[maxN];void init(int n){ for(int i=0;i<n;i++) { fa[i]原创 2015-07-11 15:42:13 · 331 阅读 · 0 评论 -
LightOJ1112——Curious Robin Hood
线段树区间总和,单点更新。#include #include #include #include using namespace std;const int maxN=100010;int tree[4*maxN];int money[maxN];void build(int no,int l,int r){ if(l==r) { tree[原创 2015-07-11 15:54:22 · 347 阅读 · 0 评论