# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165616 | beso123 | Geppetto (COCI15_geppetto) | C++14 | 824 ms | 544 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;
map<int,int> mp[100];
main(){
cin>>n>>m;
for(int k=1;k<=m;k++){
int a,b;
cin>>a>>b;
mp[a][b]=1;
mp[b][a]=1;
}
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++){
for(int j=i+1;j<n;j++){
if(b[i]==b[j] && b[i]==1){
if(mp[i+1][j+1]==1){
ind=0;
break;
}
}
}
}
if(ind)
ans++;
}
cout<<ans-1;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |