Submission #94319

#TimeUsernameProblemLanguageResultExecution timeMemory
94319theknife2001Geppetto (COCI15_geppetto)C++17
80 / 80
198 ms444 KiB
#include <bits/stdc++.h> using namespace std; int n,m; set < int > st[25]; int main() { cin>>n>>m; int u,v; for(int i=0;i<m;i++) { cin>>u>>v; u--; v--; st[u].insert(v); st[v].insert(u); } int ans=0; bool q=0; for(int i=0;i<(1<<n);i++) { q=0; for(int j=0;j<n;j++) { if((1<<j)&i) { for(int k=j+1;k<n;k++) { if((1<<k)&i) { if(st[j].find(k)!=st[j].end()) { q=1; break; } } } if(q) break; } } if(!q) ans++; } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...