#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++)
signed main(){
	int n;
	cin >> n;
	int m;
	cin >> m;
	int cnt[2500][2500]={0};
	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 = true;
		for (int j = 0; j < st.size(); j++) {
			for (int l = j + 1; l < st.size(); l++) {
				if(cnt[l][j] == 1) {
					b = 0;
				}
			}
		}
	
		if(b) ans++;
	}
	cout << ans;
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |