摘要:
原题链接 模拟+去重 代码 #include<bits/stdc++.h> using namespace std; int l[4]={1,1,-1,-1},r[4]={1,-1,-1,1}; struct unit { int x,y; bool operator<(const unit& ot 阅读全文
摘要:
原题链接 总结 1.搜索其实就是全部遍历一遍,只不过可以把遍历过的,以及接下来一看就知道不用遍历的不去遍历,也就是剪枝 2.一定要明确自己所设的搜索函数各个变量的含义!! 代码 #include<bits/stdc++.h> using namespace std; int n,k; int a[3 阅读全文
摘要:
原题链接 洛谷题解很详细,自己写了些理解在代码注释里 代码 #include<bits/stdc++.h> using namespace std; int atch[50005]={0}; int vis[50005]={0}; vector<int> G[505]; int weiy(int n 阅读全文