# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94319 | theknife2001 | Geppetto (COCI15_geppetto) | C++17 | 198 ms | 444 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 n,m;
set < int > st[25];
int main()
{
cin>>n>>m;
int u,v;
for(int i=0;i<m;i++)
{
cin>>u>>v;
u--;
v--;
st[u].insert(v);
st[v].insert(u);
}
int ans=0;
bool q=0;
for(int i=0;i<(1<<n);i++)
{
q=0;
for(int j=0;j<n;j++)
{
if((1<<j)&i)
{
for(int k=j+1;k<n;k++)
{
if((1<<k)&i)
{
if(st[j].find(k)!=st[j].end())
{
q=1;
break;
}
}
}
if(q)
break;
}
}
if(!q)
ans++;
}
cout<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |