两道较为典型的单源最短路径问题,采用dijkstra解法 本来是四道练习题,后来发现后面两道用dijkstra来解的话总觉得有点冗余了,因此暂且分成三篇博客(本篇以及后两篇)。 &nb…
分类:Online Judge
HDU 4815 Little Tiger vs. Deep Monkey(2013长春现场赛C题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 简单的DP题。 1 #include <stdio.h> 2 #includ…
HDU 1054 Strategic Game(树形DP)
Strategic Game Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja…
HDU 4612 Warm up tarjan 树的直径
Warm up 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=4612 Description N planets are connected by M bidirect…
HDU 1027 Ignatius and the Princess II (产生第m大的排列,STLmap中的next_permutation(array,array+n);)
Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536…
Educational Codeforces Round 8 F. Bear and Fair Set 最大流
F. Bear and Fair Set 题目连接: http://www.codeforces.com/contest/628/problem/F Description Limak is a grizzly bear…
BZOJ 3504: [Cqoi2014]危桥 最大流
3504: [Cqoi2014]危桥 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=3504 Description Alice和Bob居住在一个由N座岛屿组…
VK Cup 2016 - Round 1 (Div. 2 Edition) E. Bear and Contribution 单调队列
E. Bear and Contribution 题目连接: http://www.codeforces.com/contest/658/problem/E Description Codeforces is a won…
ACM/ICPC 之 拓扑排序+DFS(POJ1128(ZOJ1083)-POJ1270)
两道经典的同类型拓扑排序+DFS问题,第二题较第一题简单,其中的难点在于字典序输出+建立单向无环图,另外理解题意是最难的难点,没有之一… POJ1128(ZOJ108…
[BZOJ 1150] [CTSC2007] 数据备份Backup 【贪心 + 链表】
题目链接:BZOJ – 1150 题目分析 可以看出,我们选的 k 条边一定是相邻两点之间的线段。我们可以将每条边看成一个点,那么我们就是要在 n-1 个点中选出互不相邻的 k 个,使它们的和最…
Codeforces Round #281 (Div. 2) C. Vasya and Basketball 二分
C. Vasya and Basketball 题目连接: http://codeforces.com/contest/493/problem/C Description Vasya follows a basketba…
Codeforces Beta Round #3 B. Lorry 暴力 二分
B. Lorry 题目连接: http://www.codeforces.com/contest/3/problem/B Description A group of tourists is going to kayak…