判断存在一条Hamilton回路的图是否是平面图。
和POJ3207几乎一样,只要把 判断相交的条件改成按回路编号比较就行了。
http://blog.youkuaiyun.com/braketbn/article/details/50834302
/* Footprints In The Blood Soaked Snow */
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxm = 10005, maxn = maxm << 2, maxs = maxn, maxd = 205;
int n, m, head[maxn], cnt, dfn[maxn], low[maxn], clo, belong[maxn], tot, id[maxn];
bool ins[maxn];
struct _edge {
int v, next;
} g[maxn];
struct _pos {
int x, y;
} p[maxm];
inline int iread() {
int f = 1, x = 0; char ch = getchar();
for(; ch < '0' || ch > '9'; ch = getchar()) f = ch == '-' ? -1 : 1;
for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
return f * x;
}
inline int add(int u, int v) {
g[cnt] = (_edge){v, head[u]};
head[u] = cnt++;
}
int sta[maxs], top;
inline void tarjan(int x) {
dfn[x] = low[x] = clo++;
sta[++top] = x; ins[x]