上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 41 下一页
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1281题目大意:就是车和车之间不能发生攻击.还有一部分位置不可以放置棋子。解题思路:一行一列只能放一个,那么对于横纵坐标x和y来说一行一列只有一个交点。所以我们就可以根据X坐标与Y坐标把这些点转换为二分图... Read More
posted @ 2015-08-10 17:38 西瓜不懂柠檬的酸 Views(207) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2444题意:有n个学生,m个关系,但是如果a认识b,b认识c,但是a不一定认识c;求能不能把这n个人分成两个房间,每个房间的人互相都不认识,这就是让我们判断是不是二分图了,可以用涂色法来进行判断;如果是二... Read More
posted @ 2015-08-10 17:04 西瓜不懂柠檬的酸 Views(201) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=1469 http://acm.hdu.edu.cn/showproblem.php?pid=1083题意:有n个学生p门课, 每门课有m个人可以选择1.每个人最后都有单独的一门课;2.每门课都有人选;满足两个条件输出YES,否则NO;其... Read More
posted @ 2015-08-10 16:06 西瓜不懂柠檬的酸 Views(129) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2255带权匹配问题的模板;运用KM算法;#include#include#include#include#include#define INF 0xfffffff#define N 330using na... Read More
posted @ 2015-08-10 13:12 西瓜不懂柠檬的酸 Views(274) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1856题意就是有n对朋友,最终求最大的朋友圈的人数;所以要用并查集;#include#include#include#include#include#define N 10000010using name... Read More
posted @ 2015-08-10 09:56 西瓜不懂柠檬的酸 Views(235) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2828题意就是有n个x y每次都是把y放到x位置,如果x位置有数,则把该位置之后的数往后放一位;【题解】: 线段树节点中保存这一段中的空位数,然后倒序对pos插入: 例如: 0 77 1 51 ... Read More
posted @ 2015-08-10 09:08 西瓜不懂柠檬的酸 Views(229) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2299 题意就是求把数组按从小到大的顺序排列,每次只能交换相邻的两个数, 求至少交换了几次 就是求逆序数 #include<stdio.h> #include<string.h> #include<algorithm> #define Read More
posted @ 2015-08-09 18:31 西瓜不懂柠檬的酸 Views(188) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3177 题意:有n个牧场,Bessie 要从一个牧场到另一个牧场,要求至少要有2条独立的路可以走。现已有m条路,求至少要新建多少条路,使得任何两个牧场之间至少有两条独立的路。两条独立的路是指:没有公共边的路,但 可以经过同一个中间顶点。 Read More
posted @ 2015-08-08 16:13 西瓜不懂柠檬的酸 Views(283) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2063最大匹配模板题;#include #include #include #include #include #include #include #include #include using name... Read More
posted @ 2015-08-08 15:19 西瓜不懂柠檬的酸 Views(292) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5363#include #include #include #include #include #include #include #include #include using namespace st... Read More
posted @ 2015-08-08 08:55 西瓜不懂柠檬的酸 Views(145) Comments(0) Diggs(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 41 下一页
levels of contents