随笔分类 - 数据结构
摘要:You have two strings SS and TT in all capitals. Now an efficient program is required to maintain a operation and support a query. The operation C~i~ch
阅读全文
摘要:最小支配集: 从V中选取尽量少的点组成一个集合,让V中剩余的点都与取出来的点有边相连。 (点) 最小点覆盖: 从V中选取尽量少的点组成一个集合V1,让所有边(u,v)中要么u属于V1,要么v属于V1 (边) 最大独立集: 从V中选取尽量多的点组成一个集合,让这些点中间没有边项链,也就是说对于任何一条
阅读全文
摘要:Description Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long lon...
阅读全文
摘要:The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all pl
阅读全文
摘要:Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star
阅读全文
摘要:百度科技园内有nn个零食机,零食机之间通过n−1n−1条路相互连通。每个零食机都有一个值vv,表示为小度熊提供零食的价值。 由于零食被频繁的消耗和补充,零食机的价值vv会时常发生变化。小度熊只能从编号为0的零食机出发,并且每个零食机至多经过一次。另外,小度熊会对某个零食机的零食有所偏爱,要求路线上必
阅读全文
摘要:Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is
阅读全文
摘要:Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is
阅读全文
摘要:Given a sequence A with length n,count how many quadruple (a,b,c,d) satisfies: a≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ada≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ad.
阅读全文
摘要:Give you a tree with N vertices and N‐ 1 edges, and then ask you Q queries on “which vertex is Y's son that has the smallest number and which vertex i
阅读全文
摘要:Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 115624 Accepted: 35897 Case Time Limit: 2000MS Description You have N integers, A1, A2, ..
阅读全文
摘要:Just a Hook In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecut
阅读全文
摘要:#include #include #include #include #include #include #include #include using namespace std; typedef long long LL; #define MAXN 50009 #define N 25 #define INF 0x3f3f3f3f int t, n, a[MAXN]; struct nod...
阅读全文
摘要:动物统计加强版 时间限制:3000 ms | 内存限制:150000 KB 难度:4 动物统计加强版 时间限制:3000 ms | 内存限制:150000 KB 难度:4
阅读全文
摘要:Time Limit: 5000MS Memory Limit: 128000K Total Submissions: 37340 Accepted: 9796 Description You are given a bunch of wooden sticks. Each endpoint of
阅读全文
摘要:子序列 时间限制:3000 ms | 内存限制:65535 KB 难度:5 子序列 时间限制:3000 ms | 内存限制:65535 KB 难度:5 给定一个序列,请你求出该序列的一个连续的子序列,使原串中出现的所有元素皆在该子序列中出现过至少1次。 如2 8 8 8 1 1,所求子串就是2 8
阅读全文
摘要:相同的雪花 时间限制:1000 ms | 内存限制:65535 KB 难度:4 相同的雪花 时间限制:1000 ms | 内存限制:65535 KB 难度:4
阅读全文
摘要:士兵杀敌(五) 时间限制:2000 ms | 内存限制:65535 KB 难度:5 士兵杀敌(五) 时间限制:2000 ms | 内存限制:65535 KB 难度:5 南将军麾下有百万精兵,现已知共有M个士兵,编号为0~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互
阅读全文
摘要:joey97 Mail 0(0) Control Panel Sign Out Color the ball Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到
阅读全文