# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88652 | asifthegreat | Geppetto (COCI15_geppetto) | C++14 | 231 ms | 524 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>
using namespace std;
int ans;
int n,m;
vector<int>subset;
vector<int>v[100];
int mp[2000000];
void go(int i)
{
if(i == n+1){
int size = subset.size();
for(int i = 0; i < size;i++){
for(int j = 0; j < size;j++){
if(i == j)continue;
if(find(v[subset[i]].begin(),v[subset[i]].end(),subset[j]) != v[subset[i]].end()){
ans--;return;
}
}
}
return;
}
if(i > 10000){
cout << "sed lyf\n";exit(0);
}
go(i+1);
subset.push_back(i);
go(i+1);
subset.pop_back();
}
int main()
{
scanf("%d%d",&n,&m);
//for(int i = 0; i <= n;i++)parent[i] = i;
int a,b;
ans = 1<<(n);
//set<pair<int,int>>st;
for(int i = 1; i <= m;i++){
scanf("%d%d",&a,&b);
v[a].push_back(b);
v[b].push_back(a);
}
go(1);
cout << ans << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |