12 2021 档案
2.3搜索与图论
摘要:1.dfs n皇后问题 #include <iostream> using namespace std; const int N = 20; int n; char g[N][N]; int col[N] , dg[N] , udg[N];//列,正对角线,斜对角线 void dfs(int u){
2.2数据结构哈希表
摘要:#include <iostream> #include <cstring> using namespace std; const int N = 100003; int h[N] , e[N] , ne[N] , idx;//h是数组头,e是存的插的链表的值,ne是其下一个的idx void in