Submission #1270488

#TimeUsernameProblemLanguageResultExecution timeMemory
1270488algoproclubHiperkocka (COCI21_hiperkocka)C++20
0 / 110
1 ms324 KiB
// UUID: 933f3602-8378-4284-b5de-d248aadafd18
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


vector<pair<ll,ll>>edges;
ll h[17];
int main() {
	ll n; cin>>n;

	for(ll i=0; i<n; i++)
	{
		ll a,b;
		cin>>a>>b;
		if(a>b)swap(a,b);
		edges.push_back({a,b});
	}
	sort(edges.begin(), edges.end());
	for(ll i=0; i<n; i++)
	{
		auto[a,b]=edges[i];
		h[b]=(h[a]^(1<<(b-1)));
	}
	cout<<(1<<(n-1))<<endl;
	for(ll i=0; i<(1<<n); i++)
	{
		if((__builtin_popcount(i)%2)==0)
		{
			for(ll j=0; j<=n; j++)
			{
				cout<<(h[j]^i)<<" ";
			}cout<<"\n";
		}
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...