Description At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite sequence of Picks. Fortunately, Picks remembers how to repair the seq…
借用学长的活:60种颜色是突破口(我咋不知道QAQ) 好像这几道都是线段树+dfs序??于是你可以把60种颜色压进一个long long 里,然后向上合并的时候与一下(太妙了~) 所以记得开long long (又调了一个半小时...打代码只花了20分钟???) #include<cstdio> #include<iostream> #define ll long long #define R register int #define ls (tr<<1) #defin…
题解 弱智题,二进制表示位数.合并时用| 就是被1<<x卡了好久. 要写成1ll<<x才行 #include<iostream> #include<cstring> #include<cmath> #include<cstdio> #include<algorithm> using namespace std; ; int cnt,head[N]; int id[N],size[N],cao[N],tot; int n,m…