随笔分类 - 数据结构
线段树、平衡树(Splay , treap)、可持久化数据结构、块状链表(莫队算法)、树链剖分算法
摘要:题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the
阅读全文
摘要:题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5880 Problem Description Steam is a digital distribution platform developed by Valve Corporation offeri
阅读全文
摘要:题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5884 Problem Description Recently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob
阅读全文
摘要:题目链接 http://www.lydsy.com/JudgeOnline/problem.php?id=2038 Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说
阅读全文
摘要:题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5869 Problem Description This is a simple problem. The teacher gives Bob a list of problems about
阅读全文
摘要:题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5875 Problem Description The shorter, the simpler. With this problem, you should be convinced of
阅读全文
摘要:莫队算法 莫队算法可用于解决一类可离线且在得到区间[l,r][l,r]的答案后,能在O(1)O(1)或O(log2n)O(log2n)得到区间[l,r+1][l,r+1]或[l−1,r][l−1,r]的答案的问题 先看这样一个问题: 给出n个数字,m次询问,每次询问在区间[li,ri][li,ri
阅读全文
摘要:原题链接 http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1809 Description Bobo has a balanced parenthesis sequence P=p1 p2…pn of length n and q questions
阅读全文
摘要:原题链接 Problem Description Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has
阅读全文
摘要:原题链接 Problem Description You may heard of the Joseph Problem, the story comes from a Jewish historian living in 1st century. He and his 40 comrade sol
阅读全文
摘要:原题链接 Problem Description Given some segments which are paralleled to the coordinate axis. You need to count the number of their intersection.The input
阅读全文
摘要:原题链接 Problem Description The soil is cracking up because of the drought and the rabbit kingdom is facing a serious famine. The RRC(Rabbit Red Cross) o
阅读全文
摘要:2016暑假多校联合 Rikka with Sequence (线段树) Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka s
阅读全文
摘要:HDU 5818 Problem Description A stack is a data structure in which all insertions and deletions of entries are made at one end, called the "top" of the
阅读全文
摘要:2016暑假多校联合 Substring Problem Description ?? is practicing his program skill, and now he is given a string, he has to calculate the total number of its
阅读全文
摘要:int wa[maxn],wb[maxn],wv[maxn],ws[maxn]; int cmp(int *r,int a,int b,int l) {return r[a]==r[b]&&r[a+l]==r[b+l];} //就像论文所说,由于末尾填了0,所以如果r[a]==r[b](实际是y[a]==y[b]),说明待合并的两个长为j的字符串,前面那个一定不包含末尾0,因而后面这个的起始位...
阅读全文
摘要:51Node 1065 最小正子段和 N个整数组成的序列a[1],a[2],a[3],…,a[n],从中选出一个子序列(a[i],a[i+1],…a[j]),使这个子序列的和>0,并且这个和是所有和>0的子序列中最小的。 例如:4,-1,5,-2,-1,2,6,-2。-1,5,-2,-1,序列和为1
阅读全文
摘要:Codeforces Round #346 (Div. 2) E. New Reform E. New Reform time limit per test 1 second memory limit per test 256 megabytes input standard input outpu
阅读全文
摘要:Description During the programming classes Vasya was assigned a difficult problem. However, he doesn't know how to code and was unable to find the sol
阅读全文
摘要:NEFU专项训练十和十一——树链剖分 Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点的最大权值 I
阅读全文

浙公网安备 33010602011771号