A. NP-Hard Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very int…
The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6983 Accepted Submission(s): 3120 Problem Description There are a group of students. Some of them may know each ot…
The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4250 Accepted Submission(s): 1946 Problem Description There are a group of students. Some of them may know each ot…
题目来源:HDU 2444 The Accomodation of Students 题意:n个人能否够分成2组 每组的人不能相互认识 就是二分图判定 能够分成2组 每组选一个2个人认识能够去一个双人间 最多能够有几组 思路:二分图判定+最大匹配 #include <cstdio> #include <cstring> #include <vector> using namespace std; const int maxn = 550; int vis[maxn];…
题目大意:给你一张无向图,每一个点的度数都是3. 你的任务是推断是否能把它分解成若干个爪(每条边仅仅能属于一个爪) 解题思路:二分图染色裸题.能够得出:爪的中心点和旁边的三个点的颜色是不一样的 #include <cstdio> #include <cstring> using namespace std; #define N 310 #define M 2010 struct Edge{ int to, Next; }E[M]; int head[N], color[N], to…