柳神的能过。。我的只有20分。。
#include<iostream>
#include<vector>
using namespace std;
int e[205][205] = { 0 };
int main() {
int nv, ne, m;
cin >> nv >> ne;
for (int i = 0; i < ne; i++) {
int t1, t2;
cin >> t1 >> t2;
e[t1][t2] = e[t2][t1] = 1;
}
cin >> m;
for (int i = 0; i < m; i++) {
int k, t, tag = 1, hash[205] = { 0 };
vector<int>temp;
cin >> k;
for (int j = 0; j < k; j++) {
cin >> t;
temp.push_back(t);
hash[t] = 1;
}
for (int j = 0; j < k; j++) {
if (!tag) break;
for (int l = j + 1; l < k; l++) {
if (!e[temp[j]][temp[l]]) {
tag = 0;
break;
}
}
}
if (tag == 0)
printf("Not a Clique\n");
else {
int tag2, tag3 = 0;
for (int j = 0; j < nv; j++) {
tag2 = 1;
if (!hash[j]) {
int count2 = 0;
for (int l = 0; l < k; l++) {
if (!e[j][temp[l]])
break;
count2++;
}
if (count2 == k)
tag2 = 0;
}
if (!tag2) {
printf("Not Maximal\n");
tag3 = 1;
break;
}
}
if (!tag3)
printf("Yes\n");
}
}
return 0;
}