<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>disjoint\xa0set on The Site of laekov</title>
    <link>/tags/disjoint%5Cxa0set/</link>
    <description>Recent content in disjoint\xa0set on The Site of laekov</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>&amp;copy; laekov</copyright>
    <lastBuildDate>Fri, 28 Nov 2014 09:46:11 +0000</lastBuildDate><atom:link href="/tags/disjoint%5Cxa0set/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>BZOJ3319 黑白树</title>
      <link>/oi/lofterimport_062/</link>
      <pubDate>Fri, 28 Nov 2014 09:46:11 +0000</pubDate>
      
      <guid>/oi/lofterimport_062/</guid>
      <description>异常欢乐的并查集。馒头染色法。均摊O(n)的时间。
离线，先把每个染色操作会染黑哪些边算出来，把黑色子节点并到白色父节点里。
然后倒着处理，询问就直接用并查集问白色子节点顶上的黑色父节点最近是谁。染色操作再染回来。
#include &amp;lt;cstdio&amp;gt;
#include &amp;lt;cctype&amp;gt;
#include &amp;lt;cstring&amp;gt;
#include &amp;lt;algorithm&amp;gt;
using namespace std;
struct edge {
int t, i;
edge *next;
};
struct query {
int t, v, ans;
int *b;
};
int _d_;
#define readInt(_x_)&amp;nbsp;{&amp;nbsp;\
int&amp;amp; _s_ = _x_;&amp;nbsp;\
_s_ = 0;&amp;nbsp;\
while (!isdigit(_d_&amp;nbsp;= getchar()));&amp;nbsp;\
while ((_s_&amp;nbsp;= _s_ * 10 + _d_ - 48), isdigit(_d_ = getchar()));&amp;nbsp;\
}
const int maxn = 1000009;
int n, m, d[maxn], fa[maxn], v[maxn], c[maxn], r[maxn];</description>
    </item>
    
  </channel>
</rss>
