题目:给你一个二维的图片,上面有很多个独立的区域被用'X'的边界分隔开,有一些子区域中有填充的字符,
如果发现填充字符,就把这个子区域用这种字符填满(不会出现一个子区域中存在多余一种填充字符)。
分析:图论、搜索,floodfill。如果发现填充字符,直接利用递归填充上下左右方向的格子即可。
说明:本周刷的题好少╮(╯▽╰)╭。
#include
#include...
分类:
其他好文 时间:
2015-04-29 08:44:26
阅读次数:
124
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
分析:最大流的入门题,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
分析:找到吉米从办公室穿过森林回到家(也就是从点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
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
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
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
题目1 : 扑克牌时间限制:2000ms单点时限:1000ms内存限制:256MB描述一副不含王的扑克牌由52张牌组成,由红桃、黑桃、梅花、方块4组牌组成,每组13张不同的面值。现在给定52张牌中的若干张,请计算将它们排成一列,相邻的牌面值不同的方案数。牌的表示方法为XY,其中X为面值,为2、3、4...
分类:
编程语言 时间:
2015-04-27 12:51:20
阅读次数:
203
分析:同时计算最短距离和花费,距离相同时还要更新费用,还要同时存储正向边和反向边。
注意:不能用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