随笔分类 - 数据结构 - 主席树
摘要:DSM(Data Structure Master) once learned about tree when he was preparing for NOIP(National Olympiad in Informatics in Provinces) in Senior High School
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/139/J来源:牛客网题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., (
阅读全文
摘要:You are given a tree, it’s root is p, and the node is numbered from 1 to n. Now define f(i) as the number of nodes whose number is less than i in all
阅读全文
摘要:Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),
阅读全文
摘要:You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a ne
阅读全文
摘要:One day Polycarp decided to rewatch his absolute favourite episode of well-known TV series "Tufurama". He was pretty surprised when he got results onl
阅读全文
摘要:推荐博客 : https://blog.csdn.net/creatorx/article/details/75446472 : https://www.cnblogs.com/zyf0163/p/4749042.html 早在很久之前就听过主席树这个名词,不过一直没有去学,当时想的是先把线段树学明
阅读全文