Submission #252705

#TimeUsernameProblemLanguageResultExecution timeMemory
252705VEGAnnGeppetto (COCI15_geppetto)C++14
80 / 80
231 ms504 KiB
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() #define PB push_back using namespace std; typedef long long ll; const int N = 22; bool bad[N][N]; int n, m, ans; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); #ifdef _LOCAL freopen("in.txt","r",stdin); #endif // _LOCAL cin >> n >> m; for (int i = 0; i < m; i++){ int x, y; cin >> x >> y; x--; y--; bad[x][y] = bad[y][x] = 1; } for (int msk = 0; msk < (1 << n); msk++){ bool ok = 1; for (int i = 0; i < n && ok; i++){ if (!(msk & (1 << i))) continue; for (int j = i + 1; j < n && ok; j++){ if (!(msk & (1 << j))) continue; if (bad[i][j]) ok = 0; } } ans += ok; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...