传送门
I think
分层图问题.p枚钥匙是否拿到共有2^p种状态,用二进制表示,对于每一种状态建立分层图广搜求解.
许久不打BFS生疏了.
Code
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
const int sm = 11;
const int sn = 1<<15;
int N,M,K,S,mx,Ans;
分层图问题.p枚钥匙是否拿到共有2^p种状态,用二进制表示,对于每一种状态建立分层图广搜求解.
许久不打BFS生疏了.
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
const int sm = 11;
const int sn = 1<<15;
int N,M,K,S,mx,Ans;