#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for(int i = 0; i < (n); i++)
int cnt[21][21]={0};
signed main(){
int n;
cin >> n;
int m;
cin >> m;
rep(i,m){
int a, b;
cin >> a >> b;
cnt[a][b]=1;
cnt[b][a]=1;
}
int ans = 0;
for (int i = 0; i < (1<<n); i++){
vector<int>st;
for (int j = 0; j < n; j++) {
if((i>>j)%2){
st.push_back(j + 1);
}
}
bool b = 1;
for (int j = 0; j < st.size(); j++) {
for (int l = j + 1; l < st.size(); l++) {
if(cnt[st[j]][st[l]] >= 1) {
b = 0;
}
}
}
if(b) ans++;
}
cout << ans;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |