随笔分类 - 数据结构
线段树、平衡树(Splay , treap)、可持久化数据结构、块状链表(莫队算法)、树链剖分算法
摘要:数据结构课上学过冒泡排序、选择排序、合并排序、快速排序等等,但就是没有堆排序。以前一看到堆,就觉得是个代码很复杂的算法,而且已经有这么多同等速度的排序算法了,没必要看堆排序了。但是最近看面试题发现有大量的关于堆的知识题,所以还是得看看,看了一下发现挺简单的,而且有其他排序算法没有的优点:支持插入删除
阅读全文
摘要:题目链接 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this
阅读全文
摘要:题目连接 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
阅读全文
摘要:题目链接 Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 problem Recently George is preparing for the Graduate Record Examinations (GRE for short). Obviously the most important thing is reciting the wor
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 Problem Description > Stormtroopers were the assault/policing troops of the Galactic Empire. Dissenting citizens referred to them as bucketheads,
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文
摘要:题目链接 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
阅读全文

浙公网安备 33010602011771号