七段码--dfs+set去重/状压

1.dfs遍历i相连的边,从亮1个到7个遍历,然后最后答案用·二进制装进set里,set自动去重

2.c表示现在亮的个数,d表示要求亮的个数,pos表现在是哪个点

蓝桥账户中心

#include
using namespace std;
#define N 100011
typedef  long long ll;
typedef pair pii;
set an;
vector a[15];
int b[15];
bool bo[15];
void dfs(int pos,int c,int d)
{
	if(c==d)
	{
		int x=0;
		for(int i=1;i<=c;i++)
		{
			cout<

你可能感兴趣的:(深度优先,算法,数据结构)