摘要: 主席树模板题目 阅读全文
posted @ 2018-03-12 16:58 mybing 阅读(133) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std; int len=0,n,m,a[2001000],sum[2000100],hash[2001000],l[2000100],root[2000100],r[2000100]; inline int read() { int x=0,f=1; char ch=g... 阅读全文
posted @ 2018-03-12 14:45 mybing 阅读(114) 评论(0) 推荐(0)
摘要: 在每一个点的父亲做主席树,每次访问时用两个点的和减去其LCA和LCA父亲的和即可。 注意最后一行不换行。 阅读全文
posted @ 2018-03-12 13:48 mybing 阅读(145) 评论(0) 推荐(0)