Submission #292448

#TimeUsernameProblemLanguageResultExecution timeMemory
2924487_7_7Geppetto (COCI15_geppetto)C++17
80 / 80
404 ms520 KiB
#include <bits/stdc++.h> using namespace std; int n; int m; int used[50][50]; int main() { ios_base::sync_with_stdio(false); cin >> n >> m; for(int i = 1; i <= m; i ++){ int x, y; cin >> x >> y; used[x][y] = 1; used[y][x] = 1; } int res = 0; for(int i = 0; i < (1 << n); i ++){ vector<int> t; for(int j = 0; j < n; j ++){ if(i & (1 << j)) t.push_back(j + 1); } int good = 1; for(int j = 0; j < (int)t.size(); j ++){ for(int k = j + 1; k < (int)t.size(); k ++){ good &= (used[t[j]][t[k]] == 0); } } res += good; } cout << res << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...