数据结构
醉酒、冰城外
清华大学南京校区
展开
-
UCF Local Programming Contest 2019(Practice) F Sub Matrix Sum 【降维+二分单调栈】
DescriptionYou have written many programs to search mazes so matrix search shouldn't be any different, or will it?ProblemAn integer matrix with R rows and C columns hassub matrices. We want to select a sub matrix with sum (the sum of all integer..原创 2020-07-26 21:54:42 · 425 阅读 · 0 评论 -
ICPC NEAU Programming Contest 2020 D 旅游 【单调栈+倍增】
Description皮皮准备去旅游,共有n个景点可以选择,景点编号为1~n,每个景点都有一个“美观值”ai。共有m次查询,对于第i次查询,皮皮将从xi号景点开始游览,之后他会选择沿着编号递增的顺序选择游览其他景点,但是如果这个景点的美观值不大于他刚刚游览过的景点,他就会跳过这个景点。也就是说,皮皮在游览一个美观值为u的景点v后,他将游览的下一个景点是编号大于v、美观值大于u的,编号最小的景点。皮皮将一共访问yi个景点,请你输出他最后一个访问的景点编号,如果他不能访问yi个景点,输出-1原创 2020-06-09 11:38:13 · 176 阅读 · 0 评论 -
ICPC Latin American Regional Contests 2019 L Leverage MDT 【单调栈】
DescriptionThe kingdom of Nlogonia is a very prosperous one. Its king, Constan tourist, expanded the kingdom by conquering nearby towns. However, now that Constantourist’s life is coming to an end,...原创 2020-04-10 23:25:43 · 276 阅读 · 0 评论 -
2020牛客寒假算法基础集训营1 F maki和tree 【并查集】
题目描述有一天,maki拿到了一颗树。所谓树,即没有自环、重边和回路的无向连通图。这个树有 n 个顶点,n-1条边。每个顶点被染成了白色或者黑色。maki想知道,取两个不同的点,它们的简单路径上有且仅有一个黑色点的取法有多少?注:①树上两点简单路径指连接两点的最短路。② <p,q>和 <q,p> 的取法视为同一种。输入描述第一行一个正整数 ...原创 2020-02-07 15:43:40 · 357 阅读 · 0 评论 -
2019ICPC亚洲区域赛 (银川站) G Pot!! 【线段树区间修改+区间查询】
DescriptionLittle Q is very sleepy, and he really needs some coffee to make him awake. At this time, Little L brings a pot to Little Q, and he states the pot as follows.For a prime numberp, if...原创 2019-12-10 11:22:39 · 721 阅读 · 0 评论 -
POJ[3468] A Simple Problem with Integers 【线段树区间更新】
DescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is t...原创 2019-10-28 23:07:00 · 104 阅读 · 0 评论 -
POJ[2912] Rochambeau 【边带权并查集+枚举】
DescriptionNchildren are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty)...原创 2019-10-21 00:28:40 · 177 阅读 · 2 评论 -
HDU[3038] How Many Answers Are Wrong 【边带权并查集】
DescriptionTT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin wit...原创 2019-10-07 22:02:15 · 106 阅读 · 0 评论 -
2019牛客暑期多校训练营 (第九场) E All men are brothers 【并查集+思维】
题目描述Amy asks Mr. B problem E. Please help Mr. B to solve the following problem.There are n people, who don't know each other at the beginning.There are m turns. In each turn, 2 of them will ma...原创 2019-08-16 18:15:31 · 116 阅读 · 0 评论 -
POJ[3667] Hotel【线段树区间合并+延迟标记】
DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, ha...原创 2019-07-22 20:20:02 · 148 阅读 · 0 评论 -
2019牛客暑期多校训练营 (第八场) A All-one Matrices【降维+单调栈+前缀和】
题目描述Gromah and LZR entered the great tomb, the first thing they see is a matrix of size n×m, and the elements in the matrix are all 0 or 1.LZR finds a note board saying "An all-one matrix is defi...原创 2019-08-12 10:22:20 · 157 阅读 · 0 评论 -
Codeforces[1199D] Welfare State 【线段树单点修改+区间更新】
DescriptionThere is a country with n citizens. The i-th of them initially has ai money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns som...原创 2019-08-13 16:56:23 · 169 阅读 · 0 评论