http://acm.hdu.edu.cn/showproblem.php?pid=5971 Wrestling Match Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 25    Accepted Submission(s): 15 Problem Description Nowadays, at least one wrestli…
题目链接: hdu 5971 Wrestling Match 题意:N个选手,M场比赛,已知x个好人,y个坏人,问能否将选手划分成好人和坏人两个阵营,保证每场比赛必有一个好人和一个坏人参加. 题解:dfs染色.听说题意模糊?从样例来看,第一个例子应该是因为2可能是好人可能是坏人,所以不确定就NO了... #include <iostream> #include <cstring> #include <cstdio> #include <algorithm>…
题意:给定n个人的两两比赛,每个人要么是good 要么是bad,现在问你能不能唯一确定并且是合理的. 析:其实就是一个二分图染色,如果产生矛盾了就是不能,否则就是可以的. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #…
题目链接 题意 \(n\)人进行\(m\)场比赛,给定\(m\)场比赛的双方编号:再给定已知的为\(good\ player\)的\(x\)个人的编号,已知的为\(bad\ player\)的\(y\)个人的编号.准则是每场比赛的两个选手必定一位来自\(good\ player\),另一位来自\(bad\ player\). 问是否可以据此将所有选手划分成两个阵营. 思路 // 题意和样例都很迷... 总的来说就是二分图染色,已经染好了若干个点,问能否顺利染成一个二分图. 但是不允许有孤立点.…
传送门 •题意 给出 n 个人,m 场比赛: 这 m 场比赛,每一场比赛中的对决的两人,一个属于 "good player" 另一个属于 "bad player": 给出你 x 个已经确定的"good player" 和  y 个已经确定的 "bad player". 问是否可以将这 n 个人划分成两类,其中一类属于 "good player",另一类属于 "bad player": 即…
Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”, the rest is "bad player”. Now, Xiao Ming is referee of the wrestling match and he has a list of the matches in his…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5971 题意:有n个人,编号为1-n, 已知X个人是good,Y个人是bad,m场比赛,每场比赛都有一个good和一个bad人结合起来,问这n个人是否能被分成两种人 其实就是判断是否为二分图,用染色法判断一下就可以了 #include <stdio.h> #include <string.h> #include <math.h> #include <algorithm&…
http://acm.hdu.edu.cn/showproblem.php?pid=2444 The Accomodation of Students Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 2444 Description There are a group of students. Some of them may know…
HDU 3081 Marriage Match II (二分图,并查集) Description Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is similar as the game of playing house we used to play when we are kids. What a happy time as so many…
The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5225    Accepted Submission(s): 2374 Problem Description There are a group of students. Some of them may know each ot…