#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define INF 1e9
using namespace std;
typedef long long ll;
const ll MAXN = 100005;
void solve()
{
int n, m; cin >> n >> m;
map<pair<int, int>, int>v;
for (int i = 0; i < m; i++) {
int x, y; cin >> x >> y;
v[{x, y}]++;
}
int ans = 0;
for (int mask = 0; mask < (1 << n); mask++) {
bool flag = true;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (mask & (1 << i) && mask & (1 << j) && v[{i + 1, j + 1}]) {
flag = false;
break;
}
}
if (!flag)break;
}
if (flag)++ans;
}
cout << ans << "\n";
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;// cin>>t;
while (t--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |