随笔分类 -  数据结构

线段树、平衡树(Splay , treap)、可持久化数据结构、块状链表(莫队算法)、树链剖分算法
摘要:数据结构课上学过冒泡排序、选择排序、合并排序、快速排序等等,但就是没有堆排序。以前一看到堆,就觉得是个代码很复杂的算法,而且已经有这么多同等速度的排序算法了,没必要看堆排序了。但是最近看面试题发现有大量的关于堆的知识题,所以还是得看看,看了一下发现挺简单的,而且有其他排序算法没有的优点:支持插入删除 阅读全文
posted @ 2019-08-04 10:40 茶飘香~ 阅读(253) 评论(0) 推荐(0)
摘要:题目链接 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this 阅读全文
posted @ 2019-05-04 21:20 茶飘香~ 阅读(239) 评论(0) 推荐(0)
摘要:题目连接 Problem There is a tree with n nodes. For each node, there is an integer value ai, (1≤ai​≤1,000,000,000 for 1≤i≤n). There is q queries which are 阅读全文
posted @ 2019-05-01 17:27 茶飘香~ 阅读(472) 评论(0) 推荐(0)
摘要:题目链接 Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical 阅读全文
posted @ 2018-03-19 15:09 茶飘香~ 阅读(501) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Alice are given an array A[1..N] with N numbers.Now Alice want to build an array B by a parameter K as following rules:Initia 阅读全文
posted @ 2017-11-12 14:44 茶飘香~ 阅读(998) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Beerus needs to sort an array of N integers. Algorithms are not Beerus's strength. Destruction is what he excels. He can dest 阅读全文
posted @ 2017-11-01 20:58 茶飘香~ 阅读(354) 评论(0) 推荐(0)
摘要:题目链接 problem Recently George is preparing for the Graduate Record Examinations (GRE for short). Obviously the most important thing is reciting the wor 阅读全文
posted @ 2017-10-26 22:40 茶飘香~ 阅读(579) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Monkey A lives on a tree, he always plays on this tree.One day, monkey A learned about one of the bit-operations, xor. He was 阅读全文
posted @ 2017-10-16 16:45 茶飘香~ 阅读(355) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Dr. X is a biologist, who likes rabbits very much and can do everything for them. 2012 is coming, and Dr. X wants to take som 阅读全文
posted @ 2017-10-13 16:11 茶飘香~ 阅读(391) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Mr. 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 a 阅读全文
posted @ 2017-10-11 17:08 茶飘香~ 阅读(253) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Uncle Mao is a wonderful ACMER. One day he met an easy problem, but Uncle Mao was so lazy that he left the problem to you. I 阅读全文
posted @ 2017-09-11 18:58 茶飘香~ 阅读(390) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Yellowstar is writing an article that contains N words and 1 picture, and the i-th word contains ai characters.The page width 阅读全文
posted @ 2017-09-03 12:26 茶飘香~ 阅读(341) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Bob has a dictionary with N words in it.Now there is a list of words in which the middle part of the word has continuous lett 阅读全文
posted @ 2017-09-02 14:15 茶飘香~ 阅读(328) 评论(0) 推荐(0)
摘要:题目链接 Problem Description > Stormtroopers were the assault/policing troops of the Galactic Empire. Dissenting citizens referred to them as bucketheads, 阅读全文
posted @ 2017-09-01 19:01 茶飘香~ 阅读(287) 评论(0) 推荐(0)
摘要:题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. Ther 阅读全文
posted @ 2017-08-21 20:56 茶飘香~ 阅读(283) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Give you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r−l+1<k.G 阅读全文
posted @ 2017-08-05 10:52 茶飘香~ 阅读(316) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Give you an array A[1..n],you need to calculate how many tuples (i,j,k) satisfy that (i<j<k) and ((A[i] xor A[j])<(A[j] xor A 阅读全文
posted @ 2017-08-05 10:36 茶飘香~ 阅读(434) 评论(0) 推荐(0)
摘要:题目链接 Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to 阅读全文
posted @ 2017-07-28 15:45 茶飘香~ 阅读(711) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Once upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There we 阅读全文
posted @ 2017-07-27 21:25 茶飘香~ 阅读(361) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Given the finite multi-set A of n pairs of integers, an another finite multi-set B of m triples of integers, we define the pr 阅读全文
posted @ 2017-06-13 10:01 茶飘香~ 阅读(296) 评论(0) 推荐(0)