#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for(int i = 0; i < (n); i++)
signed main(){
int n;
cin >> n;
int m;
cin >> m;
pair<int, int> p[m];
rep(i,m){
cin >> p[i].first >> p[i].second;
}
int ans = 0;
for (int i = 0; i < (1<<n); i++){
set<int>st;
for (int j = 0; j < n; j++) {
if((i>>j)%2){
st.insert(j + 1);
}
}
bool b = true;
rep(i,m){
if(st.find(p[i].first)==st.end() and st.find(p[i].second)==st.end()){
b = false;
}
}
if(b) ans++;
}
cout << ans;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |