# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165619 | 2019-11-27T19:48:49 Z | beso123 | Geppetto (COCI15_geppetto) | C++14 | 135 ms | 504 KB |
#include <bits/stdc++.h> #define int long long using namespace std; int ans=0; int n,m; vector<int> g[100]; main(){ cin>>n>>m; for(int k=1;k<=m;k++){ int a,b; cin>>a>>b; g[a].push_back(b); g[b].push_back(a); } int N=1<<(n); for(int k=0;k<=N;k++){ bitset<22> b=k; int ind=1; for(int i=0;i<n;i++){ if(b[i]) for(int j=0;j<g[i+1].size();j++){ if(b[g[i+1][j]-1]==1){ ind=0; break; } if(!ind) break; } } if(ind) ans++; } cout<<ans-1; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 122 ms | 376 KB | Output is correct |
4 | Correct | 112 ms | 376 KB | Output is correct |
5 | Correct | 125 ms | 364 KB | Output is correct |
6 | Correct | 120 ms | 376 KB | Output is correct |
7 | Correct | 118 ms | 256 KB | Output is correct |
8 | Correct | 135 ms | 504 KB | Output is correct |
9 | Correct | 107 ms | 356 KB | Output is correct |
10 | Correct | 96 ms | 252 KB | Output is correct |