# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88636 | asifthegreat | Geppetto (COCI15_geppetto) | C++14 | 2 ms | 660 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;
bitset<2000000>vis;
int parent[2000000];
map<pair<int,int>,int>mp;
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(mp[{subset[i],subset[j]}]){
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-1);
//set<pair<int,int>>st;
for(int i = 1; i <= m;i++){
scanf("%d%d",&a,&b);
mp[{a,b}]++;
}
cout << ans << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |