/**
* author: wxhtzdy
* created: 25.07.2022 11:41:41
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<vector<bool>> g(n, vector<bool>(n));
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
--a; --b;
g[a][b] = g[b][a] = true;
}
int ans = 0;
for (int t = 0; t < (1 << n); t++) {
bool ok = true;
for (int i = 0; i < n; i++) {
if (t >> i & 1) {
for (int j = 0; j < n; j++) {
if (t >> j & 1) {
ok = (ok & !g[i][j]);
}
}
}
}
if (ok) {
ans += 1;
}
}
cout << ans << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
531 ms |
296 KB |
Output is correct |
4 |
Correct |
530 ms |
300 KB |
Output is correct |
5 |
Correct |
500 ms |
304 KB |
Output is correct |
6 |
Correct |
521 ms |
332 KB |
Output is correct |
7 |
Correct |
536 ms |
296 KB |
Output is correct |
8 |
Correct |
516 ms |
296 KB |
Output is correct |
9 |
Correct |
507 ms |
296 KB |
Output is correct |
10 |
Correct |
509 ms |
300 KB |
Output is correct |