제출 #604778

#제출 시각아이디문제언어결과실행 시간메모리
604778MilosMilutinovicGeppetto (COCI15_geppetto)C++14
80 / 80
536 ms332 KiB
/**
 *    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 timeMemoryGrader output
Fetching results...