Submission #1283494

#TimeUsernameProblemLanguageResultExecution timeMemory
1283494uranhishigGeppetto (COCI15_geppetto)C++20
80 / 80
163 ms580 KiB
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(),(a).end() #define rep(i, n) for(int i = 0; i < (n); i++) int cnt[21][21]={0}; signed main(){ int n; cin >> n; int m; cin >> m; rep(i,m){ int a, b; cin >> a >> b; cnt[a][b]=1; cnt[b][a]=1; } int ans = 0; for (int i = 0; i < (1<<n); i++){ vector<int>st; for (int j = 0; j < n; j++) { if((i>>j)%2){ st.push_back(j + 1); } } bool b = 1; for (int j = 0; j < st.size(); j++) { for (int l = j + 1; l < st.size(); l++) { if(cnt[st[j]][st[l]] >= 1) { b = 0; } } } if(b) ans++; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...