HDOJ 4751 Divide Groups
比赛的时候题意居然是反的,看了半天样例都看不懂 。。。。
Divide Groups
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 456 Accepted Submission(s): 172
This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus back to visit and take photos.
After carefully planning, Tom200 announced his activity plan, one that contains two characters:
1. Whether the effect of the event are good or bad has nothing to do with the number of people join in.
2. The more people joining in one activity know each other, the more interesting the activity will be. Therefore, the best state is that, everyone knows each other.
The event appeals to a great number of alumnus, and Tom200 finds that they may not know each other or may just unilaterally recognize others. To improve the activities effects, Tom200 has to divide all those who signed up into groups to take part in the activity at different time. As we know, one's energy is limited, and Tom200 can hold activity twice. Tom200 already knows the relationship of each two person, but he cannot divide them because the number is too large.
Now Tom200 turns to you for help. Given the information, can you tell if it is possible to complete the dividing mission to make the two activity in best state.
Each case starts with a positive integer n (2<=n<=100), which means the number of people joining in the event.
N lines follow. The i-th line contains some integers which are the id
of students that the i-th student knows, terminated by 0. And the id starts from 1.
3 0
1 0
1 2 0
#include <iostream>
#include <cstring> #include <cstdio> #include <queue> using namespace std; int guanxi[111][111],color[111]; Edge E[21000]; void Init() void Add_Edge(int u,int v) int main() |
* This source code was highlighted by YcdoiT. ( style: Codeblocks )
最新文章
- slf4j
- 谈谈GIS与地理学语言
- ASP.NET获取IP的6种方法 ( 转)
- CQRS学习——IOC,配置,仓储隔离以及QueryEntry[其三]
- BZOJ1334: [Baltic2008]Elect
- 数据搬运工DSS~介绍
- UIScrollView -2(UIScrollView 与 UIPageControl的使用): 分页查看图片
- CentOS6.5下使用NetHogs监控进程网络使用情况
- poll调用深入解析
- SLF4J warning or error messages and their meanings(转)
- linux下串口通信与管理
- OC-之AFNetworking与ASIHTTPRequest对比
- Exchange Server 内部版本号和发行日期汇总
- laravel call传参
- Vim里常见的几个不可见字符
- 网络拓扑自动发掘之三层设备惯用的SNMP OID的含义
- HTML(六)--总结
- 将excel中的数据填入word模板中-VBA
- 如何在CentOS7上安装Python3及对应问题
- discuz回贴通知插件实现-配置邮件服务器