码迷,mamicode.com
首页 >  
搜索关键字:图论    ( 2467个结果
UVa 785 - Grid Colouring
题目:给你一个二维的图片,上面有很多个独立的区域被用'X'的边界分隔开,有一些子区域中有填充的字符,             如果发现填充字符,就把这个子区域用这种字符填满(不会出现一个子区域中存在多余一种填充字符)。 分析:图论、搜索,floodfill。如果发现填充字符,直接利用递归填充上下左右方向的格子即可。 说明:本周刷的题好少╮(╯▽╰)╭。 #include #include...
分类:其他好文   时间:2015-04-29 08:44:26    阅读次数:124
POJ1128 Frame Stacking(拓扑排序)经典
Frame Stacking Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4454   Accepted: 1509 Description Consider the following 5 picture frames placed on an 9 x 8 a...
分类:编程语言   时间:2015-04-28 22:56:01    阅读次数:347
HDU ACM 1532 Drainage Ditches->网络最大流模版题(EK算法实践)
分析:最大流的入门题,BFS寻找增广路,找到则更新流量,直到找不到增广路为止。 #include #include using namespace std; #define N 202 #define MAX 0x7fffffff; class Max_Flow_EK { public: Max_Flow_EK(){} ~Max_Flow_EK(){} int Run(int n,in...
分类:编程语言   时间:2015-04-28 18:35:06    阅读次数:187
HDU ACM 1142 A Walk Through the Forest->SPFA算法+记忆化深搜
分析:找到吉米从办公室穿过森林回到家(也就是从点1到点2)的最短路径有多少条,其中要满足如果要走A到B这条路,那么就有从A到终点的距离都大于B到终点的距离。 解法:spfa算法+记忆化深搜 1、spfa求出从终点2到其他所有点的最短路 2、记忆化DFS从1开始向其他点深搜,最后结果就是dp[1]。 #include #include using namespace std; ...
分类:编程语言   时间:2015-04-28 09:55:16    阅读次数:145
POJ3553 Task schedule (拓扑排序+优先队列)经典
Task schedule Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 306   Accepted: 193   Special Judge Description There are n preemptive jobs to be processed o...
分类:编程语言   时间:2015-04-28 01:58:30    阅读次数:207
POJ2762 Going from u to v or from v to u?(强连通缩点+拓扑排序)
Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 15196   Accepted: 4013 Description In order to make their sons brave, Jiaji...
分类:编程语言   时间:2015-04-27 18:27:18    阅读次数:199
Codeforces Round #179 (Div. 2)---D. Greg and Graph(离线+floyd)
Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he has in...
分类:其他好文   时间:2015-04-27 15:17:42    阅读次数:112
hihocoder 微软编程之美2015 初赛 第二场(暴力+字典序+图论+思维算法)
题目1 : 扑克牌时间限制:2000ms单点时限:1000ms内存限制:256MB描述一副不含王的扑克牌由52张牌组成,由红桃、黑桃、梅花、方块4组牌组成,每组13张不同的面值。现在给定52张牌中的若干张,请计算将它们排成一列,相邻的牌面值不同的方案数。牌的表示方法为XY,其中X为面值,为2、3、4...
分类:编程语言   时间:2015-04-27 12:51:20    阅读次数:203
HDU ACM 3790最短路径问题(SPFA算法实现)
分析:同时计算最短距离和花费,距离相同时还要更新费用,还要同时存储正向边和反向边。 注意:不能用cin和cout,否则会超时。 #include #include using namespace std; int u[200002]; int v[200002]; int w[200002]; int p[200002]; bool vis[1001]; int d[1001]; i...
分类:编程语言   时间:2015-04-27 10:02:30    阅读次数:206
数独游戏新篇章
数独的美丽,哈密顿圈,货郎担回路,竟然是一路相通 问题...
分类:其他好文   时间:2015-04-27 09:59:57    阅读次数:638
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!