Muddy Fields Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9754   Accepted: 3618 Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, t…
Purifying Machine Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5004   Accepted: 1444 Description Mike is the owner of a cheese factory. He has 2N cheeses and each cheese is given a binary number from 00...0 to 11...1. To keep his chee…
题意: 每一个' . '有一个姑娘, E是出口,'.'是空地 , 'X' 是墙. 每秒钟每一个姑娘能够走一步(上下左右) 每秒钟每一个出口仅仅能出去一个人 给定n*m的地图, 时限T 问全部姑娘是否能在T秒内逃生,若能输出最小值,不能输出"impossible" 思路: 显然是二分答案+网络流判可行. 由于每一个出口每秒钟仅仅能出去一个人,那么就把每一个出口按时间拆点,则T秒钟就拆成T个点. 网络流建图 1.源点 到 每一个姑娘 建流量为1的边. 2.若某姑娘到 a出口须要时间为 t秒…
题意:给定一个矩阵和它的N行M列,其中有一些地方有水,现在有一些长度任意,宽为1的木板,要求在板不跨越草,用一些木板盖住这些有水的地方,问至少需要几块板子? 思路:首先想到如果没有不准跨越草的条件则跟POJ 3041题意一样(如果想看的话可以点击这里),然而这一题多了个条件,那么将矩阵转化的方式需要改变,不能直接将行列分成两个集合了.需要先查看两遍矩阵,一遍横向查看有无连续‘*’的情况,若连续说明一块板子就可以覆盖,所以标记为同样的数字,反之则不同:同理另一遍纵向查看矩阵连续'*'的情况,处理方…
Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, the rain makes some patches of bare earth quite muddy. The cows, being meticulous grazers, don't…
Taxi Cab Scheme Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5710   Accepted: 2393 Description Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up…
链接: http://poj.org/problem?id=3020 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/M Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5500   Accepted: 2750 Description The Global Aerial Research Centr…
The dog task Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2559   Accepted: 1038   Special Judge Description Hunter Bob often walks with his dog Ralph. Bob walks with a constant speed and his route is a polygonal line (possibly self-in…
Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 11694   Accepted: 5230 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
题目链接:http://poj.org/problem?id=1386 题目大意:给你若干个字符串,一个单词的尾部和一个单词的头部相同那么这两个单词就可以相连,判断给出的n个单词是否能够一个接着一个全部连通. 解题思路:其实就是让你判断是否是欧拉回路或欧拉通路,建图需要一点思维,把26个字母当成是节点,每个单词当成是一条有向边.比如单词possible就是一条p->e的有向边. 代码: #include<iostream> #include<cstdio> #include&…