题目:Weak Pair 链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 题意:给一棵树和一个定值k,每个点的值w,对于两点(u、v),如果u 是v 的祖先,且w[u]*w[v]<=k,则说u、v是弱的,问树中有多少对u、v是弱的。 思 ...
分类:
其他好文 时间:
2016-09-11 00:10:13
阅读次数:
320
题目:Sparse Graph 链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5876 题意:给出一个图(V<=20万,E<=2万),要求先化为补图(每两个点,原本有边删去边,原本没边添加边),然后问指定点S到其他每个点的最短距离。 思路: 普 ...
分类:
其他好文 时间:
2016-09-11 00:05:02
阅读次数:
197
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=4745 题意:两只兔子,在n块围成一个环形的石头上跳跃,每块石头有一个权值ai,一只从左往右跳,一只从右往左跳,每跳一次,两只兔子所在的石头的权值都要相等,在一圈内(各自不能超过各自的起点,也 ...
分类:
其他好文 时间:
2016-09-10 23:41:25
阅读次数:
150
题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5873 Problem Description A mysterious country will hold a football world championships Abnormal ...
分类:
其他好文 时间:
2016-09-10 22:08:19
阅读次数:
174
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith ...
分类:
编程语言 时间:
2016-09-10 20:35:39
阅读次数:
296
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=4283 Problem Description The TV shows such as You Are the One has been very popular. In order to ...
分类:
其他好文 时间:
2016-09-10 20:31:45
阅读次数:
146
通过获取input[type=file]的值是文件的路径,如C:\xxx\xxx\sd.jpg。可以通过split()分割成数组,因为'\'在java里是转译字符,所以可以用'\\'代替。 ...
分类:
其他好文 时间:
2016-09-10 17:33:38
阅读次数:
155
最近笔试,经常遇到需要对字符串进行快速分割的情景,主要是在处理输入的时候,而以前练习算法题或笔试,很多时候不用花啥时间考虑测试用例输入的问题。可是C++标准库里面没有像java的String类中提供的字符分割函数split ,着实不方便。那么怎么解决这个问题呢?整理了一些方法如下: 1.简洁高效的方 ...
分类:
编程语言 时间:
2016-09-10 16:14:19
阅读次数:
211
1、subString(int start);//截取从小标为start位置开始到结尾的字符串2、subString(int start,int end);//截取从小标为start位置开始到小标为end-1的字符串3、split(String s);//将根据s匹配,将字符串截成数组;比如Stri ...
分类:
其他好文 时间:
2016-09-09 22:32:00
阅读次数:
149