Gym 101097G Party
来源:互联网 发布:删除的sql语句怎么写 编辑:程序博客网 时间:2024/05/17 21:05
每次找到一条没有被完全覆盖的边,删掉两边的点。因为每次删掉的两个点至少有一个不在团中,最坏情况下也会留下
#include<cstdio>#include<algorithm>using namespace std;int map[3010][3010],out[3010],n,m;int main(){ freopen("party.in","r",stdin); freopen("party.out","w",stdout); int u,v; scanf("%d%d",&n,&m); while (m--) { scanf("%d%d",&u,&v); map[u][v]=map[v][u]=1; } for (int i=1;i<=n;i++) if (!out[i]) for (int j=i+1;j<=n;j++) if (!out[j]&&!map[i][j]) { out[i]=out[j]=1; break; } for (int i=1,j=0;j<n/3;i++) if (!out[i]) { printf("%d ",i); j++; }}
0 0
- Gym 101097G Party
- CodeForces Gym 100646D Party Party Party
- codeforces gym 100548G
- Gym 100269G-Garage
- CodeForces Gym 100735G
- CodeForces Gym 100735G
- Gym 100971G Repair
- Gym 100685G
- Codeforces-GYM-100923G
- codeforces [Gym-100814G]
- Gym 101161 G
- Gym 101246.G
- Gym 100825 G
- Gym 101201.G
- Codeforces Gym-101617G
- 四川省赛G.Party
- gym 101124 Problem E. Dance Party(概率)
- Gym 100803G Flipping Parentheses
- 洛谷 1417——烹调方案【动规】
- ehcache memcache redis 比较
- linux安装chrome,chrome安装flash player,firefox安装flash player
- android自定义属性
- 组件化入门
- Gym 101097G Party
- swap分区脚本
- tomcat配置
- 记录一次奇葩的websocket和tomcat7.0.75的bug
- Doxygen注释模板
- Boolan第一周---C++面向对象高级编程(上)
- MySQL必知必会之1
- 浅谈SVN钩子在研发流程管理中的应用
- 4.27