题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1540 哈哈,终于过了卡了很久的线段树。每个节点维护左边的最长,右边的最长和当前节点往下的最值。 更新每个节点的左右最值的时候要判断一下这个点的左右儿子的区间里有没有切断的点,如果没有那么就将 ...
分类:
其他好文 时间:
2016-08-31 21:58:06
阅读次数:
195
题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=3790 Problem Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最 ...
分类:
其他好文 时间:
2016-08-31 20:38:21
阅读次数:
187
http://acm.split.hdu.edu.cn/showproblem.php?pid=1272 对于这道题,只要找出形成的图是不是连通无环的图即可。即是判断输入的两个点是否来自同一个父亲结点。还要注意不要忘记这个图一定是互相连通的。另外注意当输入两个0的时候也是输出Yes 1 #inclu ...
分类:
其他好文 时间:
2016-08-31 10:32:38
阅读次数:
145
出现这种错误一般是在电脑上用模拟器运行APK的吧. 可以在build.gradle中这样配置下: ...
分类:
其他好文 时间:
2016-08-31 00:26:28
阅读次数:
304
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5379 Problem Description Little sun is an artist. Today he is playing mahjong alone. He suddenly ...
分类:
其他好文 时间:
2016-08-30 21:25:55
阅读次数:
235
http://acm.split.hdu.edu.cn/showproblem.php?pid=1213 1 #include<stdio.h> 2 #include<algorithm> 3 #include<iostream> 4 #include<string.h> 5 using names ...
分类:
其他好文 时间:
2016-08-30 21:21:27
阅读次数:
224
http://acm.split.hdu.edu.cn/showproblem.php?pid=1232 1 ///1232 2 #include<stdio.h> 3 #include<string.h> 4 #include<iostream> 5 #include<algorithm> 6 u ...
分类:
其他好文 时间:
2016-08-30 21:04:08
阅读次数:
214
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1806 题意:给1~n个单调不递减的数,求q次区间出现次数最多的那个数的次数。 由于单调不递减,是有一个顺序的。则可以考虑记录一个b(i)=第i个数字在前i个里出现了i次,一定是连续的。这样把 ...
分类:
其他好文 时间:
2016-08-30 21:03:28
阅读次数:
157
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1257 方法: 每次拿到一个值,判断他与前面的下降子序列中的最小值最接近的那个序列,然后把那个序列的最小值更新,如果前面的下降子序列 的最小值没有比这个值大的,就另开数组把他当成一个新的子序列 ...
分类:
其他好文 时间:
2016-08-30 17:37:06
阅读次数:
99
/**String 中 replaceAll(),matches(),split() 等方法,都是调用Pattern中的方法。学习了,瞬间觉得Pattern强大了 public String replaceAll(String regex, String replacement) { return ...
分类:
编程语言 时间:
2016-08-29 19:37:45
阅读次数:
227