随笔分类 -  搜索——DFS

摘要:"ref" 我好菜啊 cpp include include include include using namespace std; int n, u[2005], v[2005], f[2005][11][11][11][11]; int dis(int x, int y){ return ab 阅读全文
posted @ 2018-05-22 14:28 poorpool 阅读(257) 评论(0) 推荐(0)
摘要:就是一步一步把大的往目标地放。 cpp include include using namespace std; int fro[55], too[55], cnt, uu, n, ans=0; void dfs(int x, int qu){ if(fro[x]==qu) return ; for 阅读全文
posted @ 2017-12-19 21:39 poorpool 阅读(169) 评论(0) 推荐(0)
摘要:搜索+背包就是了 cpp include include include using namespace std; int n, m, a[25], ans=0, lst=0; bool isu[25], f[2005]; void dfs(int x){ if(x==m+1){ int cnt=0 阅读全文
posted @ 2017-12-19 20:43 poorpool 阅读(112) 评论(0) 推荐(0)
摘要:搞上一棵AC自动机,想让它无限匹配,dfs找环即可 cpp include include include include using namespace std; int n, len; char a[30005]; queue d; bool vis[30005], tmp[30005]; st 阅读全文
posted @ 2017-12-07 19:39 poorpool 阅读(119) 评论(0) 推荐(0)