A 最短路
思路
很明显和最短路本身没啥关系。 把所有边的边权排个序，然后任意相邻的两条边如果边权之差大于$s$很明显就不能构造出这样的图，这时输出$1$即可。否则直接按照顺序用双指针记录重边然后连边，思路不难。
代码
1 

起时无数平民哭声高，落时几个帝王卷入波涛去
很明显和最短路本身没啥关系。 把所有边的边权排个序，然后任意相邻的两条边如果边权之差大于$s$很明显就不能构造出这样的图，这时输出$1$即可。否则直接按照顺序用双指针记录重边然后连边，思路不难。
1  #include <algorithm> 
In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Apples. The cows are now tired of often being forced to take a particular path and want to build some new paths so that they will always have a choice of at least two separate routes between any pair of fields. They currently have at least one route between each pair of fields and want to have at least two. Of course, they can only travel on Official Paths when they move from one field to another.
Given a description of the current set of R (F1 <= R <= 10,000) paths that each connect exactly two different fields, determine the minimum number of new paths (each of which connects exactly two fields) that must be built so that there are at least two separate routes between any pair of fields. Routes are considered separate if they use none of the same paths, even if they visit the same intermediate field along the way.
There might already be more than one paths between the same pair of fields, and you may also build a new path that connects the same fields as some other path.
Line 1: Two spaceseparated integers: F and R
Lines 2..R+1: Each line contains two spaceseparated integers which are the fields at the endpoints of some path.
Line 1: A single integer that is the number of new paths that must be built.
题目来源：
In ZJNU, there is a wellknown 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 ACM/ICPC team, we have an obligation to protect pleasant sheep and his companions to free from being disturbed by big big wolf. We decided to build a number of unit fence whose length is 1. Any wolf and sheep can not cross the fence. Of course, one grid can only contain an animal.
Now, we ask to place the minimum fences to let pleasant sheep and his Companions to free from being disturbed by big big wolf and his companions.
There are many cases.
For every case:
N and M（N,M<=200）
then N*M matrix:
0 is empty, and 1 is pleasant sheep and his companions, 2 is big big wolf and his companions.
For every case:
First line output “Case p:”, p is the pth case;
The second line is the answer.