#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	ll n,m,i,j,a,b,k,ans=0;
	cin>>n>>m;
	set<pair<ll,ll>> st;
	vector<ll> cnt(n+1,0);
	for(i=0 ; i<m ; i++){
		cin>>a>>b;
		st.insert({a,b});
		st.insert({b,a});
	}
	for(i=1 ; i<=n ; i++){
		for(j=1 ; j<=n ; j++){
			if(i==j) continue;
			if(st.count({i,j})==0 and st.count({j,i})==0) cnt[i]++;
		}
	}
	for(i=1 ; i<=n ; i++){
		if(cnt[i]==0) continue;
		for(j=1 ; j<i ; j++){
			if(st.count({i,j})==0 and st.count({j,i})==0) cnt[i]--;
		}
		ans+=(1LL<<cnt[i])-1;
	}
	ans+=n+1;
	cout<<ans;
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |