摘要:需要注意两个地方:1.修改整棵子树就是节点的size,因为子树映射到线段树上是连续的2.并不是区间修改成一个值,所以预处理出子树的和,然后ok数组判断是否被占领 1 #pragma comment(linker,"/STACK:1024000000,1024000000") 2 #include...
阅读全文
摘要:1 #include 2 #include 3 int cnt,now,a[50005]; 4 int next[100005],head[100005],point[100005]; 5 int num[50005],deep[50005],son[50005],father[5000...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 vectorcol[100005]; 7 int cnt,now; 8 int maxv[400010],ans[100005],maxx[40...
阅读全文
摘要:这是常规的使用线段树超时: 1 #pragma comment(linker, "/STACK:16777216") 2 #include 3 #include 4 long long ans[2][100005]; 5 int next[200005],head[100005],poin...
阅读全文
摘要:1 #include 2 #include 3 int now,cnt,d[100005][5]; 4 int next[100005],head[100005],point[100005]; 5 int son[100005],father[100005],num[100005],de...
阅读全文
摘要:1 #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include 3 #include 4 int now,cnt,d[50005][5]; 5 int next[100005],head[50005],point[...
阅读全文
摘要:1 #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include 3 #include 4 int now,cnt,n,a[50005]; 5 int next[100005],head[50005],point[1...
阅读全文