题意: 题意是一个人他要从牧场1走到牧场n然后在走回来,每条路径只走一次,问全程的最短路径是多少. 思路: 这个题目挺简单的吧,首先要保证每条边只能走一次,然后还要要求费用最小,那么我们可以直接跑费用流啊!还有题目说的是去了又回来,这个地方我们可以直接一次跑出两条路径,就是起始的时候的流量是2就行了,然后一遍费用流,然后就wa了,这个题目最坑人的地方就是他的输入叙述,说的什么The starting field, the end field, and the path'…
Intervals Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5762 Accepted: 2288 Description You are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize t…
Intervals Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7218 Accepted: 3011 Description You are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize t…
题意:从1到n再到1,每条边只能走一次,求最短距离. 建图:每条边只能走一次就是流量是1,添加源点与1相连,容量为2,费用为0,n与汇点相连容量为2,费用为0: 求增广路用SPFA最短路求,, #include<stdio.h> #include<queue> #include<string.h> const int N=1100; const int inf=0x3fffffff; using namespace std; int cost[N],start,end,…
http://poj.org/problem?id=2175 Evacuation Plan Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3256 Accepted: 855 Special Judge Description The City has a number of municipal buildings and a number of fallout shelters that were build…
You are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize the total weights under the limit that no point in the real axis is covered more than k times. Input The f…
题面 Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods from him.Dearboy has M supply places (marked from 1 to M), each provides K different k…
题面 On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need to pay a $1 travel fee for every step he moves,…
题目链接 Farm Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18961 Accepted: 7326 Description When FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the fir…