随笔分类 -  树套树

摘要:#include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #define N 30000 #define M 120000 using namespace std; int ans,sz,n,m; int a[ 阅读全文
posted @ 2016-05-30 11:01 ACist 阅读(176) 评论(0) 推荐(0)
摘要:做法:三维,然后这题正解是传统的cdq分治+排序+树状数组,设花的三个属性为x,y,z,我们将花按x为第一关键字,y为第二关键字,z为第三关键字排序,将属性完全相同的缩成一朵花即可,同时维护sum数组,即属形为(x,y,z)的个数,所以在维护树状数组的时候不能+1,而应该+sum[x]。排序后,后面 阅读全文
posted @ 2016-05-29 20:40 ACist 阅读(195) 评论(0) 推荐(0)
摘要:传送们:http://www.lydsy.com/JudgeOnline/problem.php?id=3196 题解:线段树+treap #include<algorithm> #include<iostream> #include<cstring> #include<cmath> #includ 阅读全文
posted @ 2016-05-29 20:33 ACist 阅读(190) 评论(0) 推荐(0)
摘要:传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1901 题解:树套树,线段树+treap(sb的我以为有多组数据。。。。。。呃呵呵呵狂RE) #include<iostream> #include<cstring> #include<cmat 阅读全文
posted @ 2016-05-29 20:31 ACist 阅读(241) 评论(0) 推荐(0)