标签:read mes using || pac mat ace poi ring
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#define ll long long
using namespace std;
inline int read(){
int x=0,o=1;char ch=getchar();
while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
if(ch=='-')o=-1,ch=getchar();
while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
return x*o;
}
const int N=3005;
int bj[N],w[N][N];
int main(){
int n=read(),m=read();
for(int i=1;i<=m;++i){
int a=read(),b=read();
w[a][b]=w[b][a]=1;
}
for(int i=1;i<=n;++i){
if(bj[i])continue;
for(int j=1;j<=n;++j){
if(bj[j])continue;
if(!w[i][j]&&i!=j){
bj[i]=1;bj[j]=1;
break;
}
}
}
int now=0;
for(int i=1;i<=n;++i){
if(!bj[i]){
printf("%d ",i);
++now;
}
if(now==n/3)break;
}
printf("\n");
return 0;
}
标签:read mes using || pac mat ace poi ring
原文地址:https://www.cnblogs.com/PPXppx/p/11348131.html