09 2016 档案
摘要:#include #include using namespace std; #define INF 0x3f3f3f3f #define LL long long int a[10005],b[10005],n; void select_sort() { int i,j,x; for(i=0;i0 && tmp #include #include #inc...
阅读全文
摘要:http://poj.org/problem?id=3140 依然是差异最小问题,不过这次是去边。思路是这样的,先记录每个点的子节点个数,然后遍历每个边。 有两个问题要注意: abs可能会出编译适配问题,可以自己写一个 INF对LL是不够用的,所以加了个INFL
阅读全文
摘要:http://poj.org/problem?id=2378 这题和找重心基本一样,判断条件换一下就行
阅读全文
摘要:http://poj.org/problem?id=3107 这实际上就是找重心,在之前有做过:http://www.cnblogs.com/qlky/p/5780933.html
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3586 http://blog.csdn.net/woshi250hua/article/details/7639423 题目大意:给定n个敌方据点,1为司令部,其他点各有一条边相连构成一棵树,每条边都有
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4276 一般题目是求回到原地,而这道题规定从1进n出。所以1-n这条路是必走,其他走不走无所谓。 这样很自然通过dfs先处理1-n这条路,统计这条路的花费时间cost,同时将这条上的边权设为0。 接下来就是求m-c
阅读全文

浙公网安备 33010602011771号