可持久化数据结构
RJ28
小学生
展开
-
Hdu-5438 Boring counting(可持久化线段树)
DescriptionIn this problem we consider a rooted tree with N vertices. The vertices are numbered from 1 to N, and vertex 1 represents the root. There are integer weights on each vectice. Your task原创 2016-10-16 18:16:32 · 305 阅读 · 0 评论 -
Hdu-2665 Kth number(主席树)
Problem DescriptionGive you a sequence and ask you the kth big number of a inteval. InputThe first line is the number of the test cases. For each test case, the first line contain原创 2016-10-05 16:05:41 · 242 阅读 · 0 评论 -
带修改的主席树
时间空间复杂度均为n*log^2,时间还好,空间简直爆炸。。。#include #include #include #include #include #include #include #include #include #include #include #include #define MOD 1000000007#define N 100005usi原创 2016-10-05 18:16:32 · 1412 阅读 · 3 评论 -
Hdu-5919 Sequence II(主席树在线求区间不同数)
DescriptionMr. Frog has an integer sequence of length n, which can be denoted as a1,a2,⋯,an There are m queries. In the i-th query, you are given two integers li and ri. Consider the subse原创 2016-10-05 23:32:52 · 680 阅读 · 0 评论 -
Hdu-4348 To the moon(可持久化线段树)
DescriptionBackground To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker.The premise of To The Moon is based around a techn原创 2016-10-08 15:19:33 · 514 阅读 · 0 评论 -
Codeforces Round #402 (Div. 1) C. Peterson Polyglot(字典树合并/可持久化字典树)
Peterson loves to learn new languages, but his favorite hobby is making new ones. Language is a set of words, and word is a sequence of lowercase Latin letters.Peterson makes new language every mo原创 2017-02-28 11:15:37 · 974 阅读 · 2 评论 -
Hdu-4757 Tree(可持久化字典树)
Problem Description Zero and One are good friends who always have fun with each other. This time, they decide to do something on a tree which is a kind of graph that there is only one path from nod原创 2017-02-28 17:52:07 · 486 阅读 · 0 评论 -
Codeforces Round #406 (Div. 1) C. Till I Collapse(可持久化线段树)
Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated n Mr. Meeseeks, standing in a line numbered from 1 to n. Each of them has his own原创 2017-04-03 14:55:30 · 706 阅读 · 1 评论 -
Codeforces Round #429 (Div. 1) D. Destiny(主席树)
D. Destinytime limit per test2.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputOnce, Leha found in the left pocket an array c原创 2017-08-25 17:08:05 · 432 阅读 · 0 评论