Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #pragma comment(linker, "/STACK:66777216")
- #include <iostream>
- #include <cstdio>
- #include <cmath>
- #include <vector>
- #include <ctime>
- #include <map>
- #include <set>
- #include <string>
- #include <queue>
- #include <deque>
- #include <cassert>
- #include <cstdlib>
- #include <bitset>
- #include <algorithm>
- #include <string>
- #include <list>
- #include <fstream>
- #include <cstring>
- #include <unordered_set>
- #include <unordered_map>
- using namespace std;
- typedef unsigned long long ull;
- typedef long long ll;
- typedef long double ld;
- #define forn(i, n) for (int i = 0; i < (int)n; i++)
- #define fornn(i, q, n) for (int i = q; i < (ll)n; i++)
- #define mp make_pair
- #define pk push_back
- #define all(v) v.begin(), v.end()
- #define times clock() * 1.0 / CLOCKS_PER_SEC
- #define prev pprev
- #define TASK "elections"
- const double EPS = 1e-7;
- const double PI = acos(-1.0);
- const ll INF = (ll)2e9 + 1;
- const ll LINF = (ll)8e18;
- const ll MM = (ll)1e9 + 7;
- const ll MOD = (ll)1e9 + 7;
- int solve();
- void gen();
- int main() {
- #ifdef _DEBUG
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #else
- //freopen(TASK".in", "r", stdin), freopen(TASK".out", "w", stdout);
- //freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout), freopen("test.txt", "w", stderr);
- #endif
- solve();
- return 0;
- }
- const int MAXN = (int)2e5 + 14;
- const int MAXC = 2007;
- const int P = 997;
- int G[20][20];
- int solve() {
- int n, m;
- cin >> n >> m;
- forn(i, m) {
- int q, w;
- cin >> q >> w;
- G[q - 1][w - 1] = 1;
- G[w - 1][q - 1] = 1;
- }
- ll cnt = 0;
- forn(i, 1 << n) {
- bool ok = true;
- forn(j1, 20) {
- fornn(j2, j1 + 1, 20) {
- if (((1 << j1) & i) && ((1 << j2) & i) && G[j1][j2]) {
- ok = false;
- }
- }
- }
- if (ok)
- cnt++;
- }
- cout << cnt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement