随笔分类 - 搜索
摘要:挖坑 #include <iostream> #include <cstdio> #include <cstring> #include <set> #include <cmath> #include <vector> using namespace std; const int N=17; con
阅读全文
摘要:深度优先搜索 小木棍 int cnt=0; bool dfs(int len,int now,int used,int last)//枚举的长度 现在拼的长度 使用的棍棒数量 { if((used==n)&&(now==len)) return 1; if(now==len) { int fail=
阅读全文
摘要:给定m个长度为n的序列 每个序列选一个数求和,求最小的n个 用堆来模拟搜索的过程 关键在于状态不重复 朴素写法: 用map来维护m个指针,判重 但是空间复杂度是的会爆 #include <iostream> #include <cstdio> #include <cstring> #in
阅读全文