题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3046 In ZJNU, there is a well-known prairie. And it attracts pleasant sheep and his companions to have a holiday. Big big wolf and his families know about this, and quietly hid in the big lawn. As ZJNU A…
HDU 3046 Pleasant sheep and big big wolf 题目链接 题意:一个n * m平面上,1是羊.2是狼,问最少要多少围墙才干把狼所有围住,每有到达羊的路径 思路:有羊和狼.要分成两个集合互不可达.显然的最小割.建图源点连狼,容量无穷,羊连汇点,容量无穷.然后相邻格子连边.容量为1 代码: #include <cstdio> #include <cstring> #include <queue> #include <algorithm…
Pleasant sheep and big big wolf Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 304664-bit integer IO format: %I64d Java class name: Main In ZJNU, there is a well-known prairie. And it attracts pleas…
Pleasant sheep and big big wolf Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3316 Accepted Submission(s): 1360 Problem Description In ZJNU, there is a well-known prairie. And it attracts p…
Smallest Minimum Cut Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1181 Accepted Submission(s): 473 Problem Description Consider a network G=(V,E) with source s and sink t. An s-t cut is a…
There is a war Problem Description There is a sea. There are N islands in the sea. There are some directional bridges connecting these islands. There is a country called Country One located in Island 1. There is another…
Problem Description度度熊国王率领着喵哈哈族的勇士,准备进攻哗啦啦族.哗啦啦族是一个强悍的民族,里面有充满智慧的谋士,拥有无穷力量的战士.所以这一场战争,将会十分艰难.为了更好的进攻哗啦啦族,度度熊决定首先应该从内部瓦解哗啦啦族.第一步就是应该使得哗啦啦族内部不能同心齐力,需要内部有间隙.哗啦啦族一共有n个将领,他们一共有m个强关系,摧毁每一个强关系都需要一定的代价.现在度度熊命令你需要摧毁一些强关系,使得内部的将领,不能通过这些强关系,连成一个完整的连通块,以保证战争的顺利进…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2485 Destroying the bus stations Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2651 Accepted Submission(s): 891 Problem Description Gabi…
Problem A simple brute force problem (HDU 4971) 题目大意 有n个项目和m个问题,完成每个项目有对应收入,解决每个问题需要对应花费,给出每个项目需解决的问题以及各问题间的依赖关系,求最大利润. 解题分析 最大权闭合子图 用来解决一下有依赖关系的问题. X集权值为正,Y集权值为负.X集的某些点依赖于Y集,Y集的某些点互相依赖. 从S向X集的每个点连流量为权值的边,y集的每个点向T连流量为权值的边,若两个点互相依赖,则连一条权值为INF的边. 求一遍最…
http://acm.hdu.edu.cn/showproblem.php?pid=4289 Control Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2247 Accepted Submission(s): 940 Problem Description You, the head of Department of Secu…
Barricade Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 997 Accepted Submission(s): 306 Problem Description The empire is under attack again. The general of empire is planning to defend his…
Give out candies Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 218 Accepted Submission(s): 66 Problem Description There are n children numbered 1 to n, and HazelFan's task is to give out…