- 博客(10)
- 收藏
- 关注
原创 次短路(POJ - 3255 Roadblocks )
DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery alon...
2018-12-23 11:38:00 192
转载 hdu2586How far away ?(Tarjan离线LCA)
题目大意:有n个点,同n-1条带有权值的双向边相连,有m个询问,每个询问包含两个数x,y,求x与y的最短距离。例:Sample Input23 21 2 103 1 151 22 3 2 21 2 1001 22 1 Sample Output1025100100 解题思路:LCA的模板题,刚开始学。。。用LC...
2018-12-19 20:57:02 183
原创 CF1082B Vova and Trophies(模拟)
Vova has won n trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row.The beauty of the arrangement is the length of the longest subsegment c...
2018-12-19 18:29:16 238
原创 cf 1012B Chemical table
思路:对我这种新手来说挺难想到的并查集吧,好歹看了题解能明白了每一行和每一列都看成并查集中的一个点,所以一共有n+m个点,可以看出,只要一个矩形只要三个角上的点有共同的祖先,那么第四个点的x和y的祖先肯定也是它(可以模拟一下),所以出现一个点就将这个点的x和y合并,最后循环n+m 看哪一行或者哪一边没有加进来,遇到一个让ans++,注意最后的结果是 ans-1B. Chemic...
2018-12-14 12:04:54 182
原创 Anniversary party (第一道树状dp)
Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the s...
2018-12-12 12:31:03 242
原创 Uva 10382 Watering Grass(贪心区间覆盖+)
n sprinklers are installed in a horizontal strip of grass l meters long andw meters wide. Each sprinkler is installed at the horizontal center line of the strip. For each sprinkler we are given it...
2018-12-07 00:33:08 205
原创 Uva 11729 Commando War 贪心啦
Sample Input 32 53 22 133 34 45 50Output for Sample InputCase 1: 8Case 2: 15 图片摘自:https://me.csdn.net/SunnyYoona 思路:贪心,什么交贪...
2018-12-04 22:32:31 180
原创 HihoCoder - 1110 Regular Expression区间dp
描述给定一个字符串,判断其是否为合法的正则表达式。 一个正则表达式定义为: 1:0是正则表达式,1也是正则表达式。 2:P和Q都是正则表达式,则PQ是正则表达式。 3:P是正则表达式,则(P)是正则表达式 4:P是正则表达式,则P*也是正则表达式 5:P和Q都是正则表达式,则P|Q是正则表达式。输入输入包含多组数据。每组数据为一行一个字符串,长度不超过100。...
2018-12-03 22:24:30 181
原创 未搞定!CodeForces - 325B Stadium and Games 二分
题目链接:http://codeforces.com/problemset/problem/325/B思路: (引用博客:https://blog.csdn.net/qq_41958841/article/details/82900074) 只看懂了题意和做法,代码过几天研究,加油!! ...
2018-12-02 18:33:55 178
原创 CodeForces - 320D A - Psychos in a Line(栈)
There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho who has an id greater than the psycho to his right (if exists) kills his right n...
2018-12-02 15:44:03 384
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人