Submission #97908

#TimeUsernameProblemLanguageResultExecution timeMemory
97908314rateNorela (info1cup18_norela)C++14
0 / 100
2 ms384 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...