标签:插入 space 一个 空间 scl 最大团 ios main back
#include<iostream>
#include<vector>
using namespace std;
int eq[210][210];
int main(){
int ne, nv, m, k, ta,tb;
scanf("%d%d", &nv, &ne);
for(int i = 0; i < ne; i++){
scanf("%d%d", &ta, &tb);
eq[ta][tb] = eq[tb][ta] = 1;
}
scanf("%d", &m);
for(int i = 0; i < m; i++){
scanf("%d", &k);
int hash[210] = {0}, isClique = 1, isMaximal = 1;
vector<int> v;
int num;
for(int j = 0; j < k; j++){
scanf("%d", &num);
v.push_back(num);
hash[v[j]] = 1;
}
for(int j = 0; j < k; j++){
if(isClique == 0) break;
for(int l = j + 1; l < k; l++){
if(eq[v[j]][v[l]] == 0){
isClique = 0;
printf("Not a Clique\n");
break;
}
}
}
if(isClique == 0) continue;
for(int j = 1; j <= nv; j++){
if(hash[j] == 0){
for(int l = 0; l < k; l++){
if(eq[v[l]][j] == 0) break;
if(l == k - 1) isMaximal = 0;
}
}
if(isMaximal == 0){
printf("Not Maximal\n");
break;
}
}
if(isMaximal == 1) printf("Yes\n");
}
return 0;
}
标签:插入 space 一个 空间 scl 最大团 ios main back
原文地址:https://www.cnblogs.com/tsruixi/p/13166259.html