# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165619 | beso123 | Geppetto (COCI15_geppetto) | C++14 | 135 ms | 504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |