题目链接
题意:给出一个树;三种操作
1 v 表示把v及其子树全部变为1
2 v 表示把v及其祖先全部变为0
3 v 查询v的值
数组尽管开吧,,,
然后,祖先就是1到该点,不要想太多- -
子树的编号在剖分的编号中是连续的,[p[x],p[x]+size[x]-1]
#pragma comment(linker, "/STACK:102400000,102400000")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define cl(a,b) memset(a,b,sizeof(a))
#define fastIO ios::sync_with_stdio(false);cin.tie(0);
#define ll long long
#define pb push_back
#define gcd __gcd
const double EPS = 1e-8;
const int maxn = 1e6+1000;
const int inf = 1 << 28;
int n,m;
struct Edge{
int to,next;
}es[maxn<<1];
int head[maxn],tot;