Submission #97908

# Submission time Handle Problem Language Result Execution time Memory
97908 2019-02-19T13:38:06 Z 314rate Norela (info1cup18_norela) C++14
0 / 100
2 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

int n,m;
ll mask[30];

int st[30],vf=0;

void go(int p,ll cur)
{
        if(p>m)
        {
                if(cur==0)
                {
                        for(int i=1;i<=vf;i++)
                        {
                                cout<<st[i]<<" ";
                        }
                        cout<<"\n";
                        exit(0);
                }
        }
        else
        {
                st[++vf]=p;
                go(p+1,(cur^mask[p]));
                vf--;
                go(p+1,cur);
        }
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        cin>>n>>m;
        for(int i=1;i<=m;i++)
        {
                int l;
                cin>>l;
                for(int j=1;j<=l;j++)
                {
                        int bit;
                        cin>>bit;
                        bit--;
                        mask[i]+=(1LL<<bit);
                }
        }
        go(1,(1LL<<n)-1);
        return 0;
}
/**

**/


# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -