树结构
RookieZQF
尽自己最大努力才能不后悔
展开
-
Directory Listing
DescriptionGiven a tree of UNIX directories and file/directory sizes, you are supposed to list them as a tree with proper indention and sizes.InputThe input consists of several test cases. Eac翻译 2015-11-09 07:29:01 · 432 阅读 · 0 评论 -
BZOJ 2555: SubString
2555: SubStringTime Limit: 30 Sec Memory Limit: 512 MBSubmit: 2880 Solved: 861[Submit][Status][Discuss]Description 懒得写背景了,给你一个字符串init,要求你支持两个操作 (1):在当前字符串的后面插入一个字符串原创 2017-08-03 13:14:00 · 358 阅读 · 0 评论 -
NOIP 2005 等价表达式(hash算法)
题目描述 Description明明进了中学之后,学到了代数表达式。有一天,他碰到一个很麻烦的选择题。这个题目的题干中首先给出了一个代数表达式,然后列出了若干选项,每个选项也是一个代数表达式,题目的要求是判断选项中哪些代数表达式是和题干中的表达式等价的。这个题目手算很麻烦,因为明明对计算机编程很感兴趣,所以他想是不是可以用计算机来解决这个问题。假设你是明明,能完成这个任务吗?原创 2017-03-23 17:05:49 · 1107 阅读 · 0 评论 -
HDU A Simple Problem with Integers
DescriptionLet A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is to q翻译 2016-02-29 19:13:16 · 318 阅读 · 0 评论 -
数轴染色
题目描述 Description在一条数轴上有N个点,分别是1~N。一开始所有的点都被染成黑色。接着我们进行M次操作,第i次操作将[Li,Ri]这些点染成白色。请输出每个操作执行后剩余黑色点的个数。输入描述 Input Description输入一行为N和M。下面M行每行两个数Li、Ri输出描述 Output Description翻译 2016-02-20 08:55:59 · 796 阅读 · 0 评论 -
NYOJ 600 花儿朵朵
描述输入第一行有个整数t,表示有t组测试数据,每组测试数据第一行为两个整数n,m(0输出对于每次游客的询问,输出一个整数在单独的一行,表示这个时间盛开的花有多少种。样例输入21 15 1042 31 44 8146样例输出0121春天到了,花儿朵朵盛开,hrdv是一座大花园的主人,在他的花园里种着许多种鲜花,每当这个时候,就会有一大群翻译 2016-01-25 20:47:22 · 393 阅读 · 0 评论 -
POJ 3321 Apple Tree
DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.翻译 2016-01-23 18:45:58 · 332 阅读 · 0 评论 -
POJ1703 Find them, Catch them
DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to iden翻译 2016-01-21 18:57:28 · 225 阅读 · 0 评论 -
BC 68 Tree
问题描述有一个树(n个点, n−1条边的联通图),点标号从1~n,树的边权是0或1.求离每个点最近的点个数(包括自己).输入描述第一行一个数字T,表示T组数据.对于每组数据,第一行是一个n,表示点个数,接下来n−1,每行三个整数u,v,w,表示一条边连接的两个点和边权.T=50,1≤n≤100000,1≤u,v≤n,0≤w≤1输出描述翻译 2016-01-19 18:40:10 · 236 阅读 · 0 评论 -
Suzhou Adventure
描述Little Hi is taking an adventure in Suzhou now. There are N beautiful villages in Suzhou which are numbered from 1 to N. They connected by N-1 roads in such a way that there is excactly one way to原创 2015-12-13 20:51:19 · 849 阅读 · 0 评论 -
红黑树
红黑树的5个特性:(1) 每个节点或者是黑色,或者是红色。(2) 根节点是黑色。(3) 每个叶子节点是黑色。(4) 如果一个节点是红色的,则它的子节点必须是黑色的。(5) 从一个节点到该节点的子孙节点的所有路径上包含相同数目的黑节点。原创 2017-09-08 15:39:53 · 335 阅读 · 0 评论