
图论
12
explorer1212
这个作者很懒,什么都没留下…
展开
-
POJ-1321
#include <iostream>#include <cstring>#include <cstdio>using namespace std;int n, k;const int N = 10;char mp[N][N];int num;bool row[N];int sum;typedef struct { int x, y;}Position;void Init() { num = 0; memset(row, true, s原创 2020-09-01 17:16:18 · 142 阅读 · 0 评论 -
搜索中遇到的问题
1、要记得遍历后让vis[x][y] = true;2、在对所有满足条件的点做DFS时,直接用两层循环 for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { if (check(i, j)) { DFS(i, j); ans++; }原创 2020-07-28 10:59:08 · 250 阅读 · 0 评论 -
Dijkstra注意
1、初始化。2、开的边的数量,无向边要多开。原创 2020-06-25 17:46:18 · 127 阅读 · 0 评论 -
Havel_Theorem
#include <cstdio>#include <algorithm>#include <cstring>#include <iostream>#define MAXN 30using namespace std;struct Node { int degree; /* 度数 */ int index; /* 序号 ...原创 2020-03-11 22:57:54 · 121 阅读 · 0 评论