随笔分类 -  图论——2-SAT

摘要:学习建图 cpp include include include using namespace std; int n, m, hea[2005], cnt, scc, ind, dfn[2005], loo[2005], bel[2005]; int uu, vv, ww, sta[2005], 阅读全文
posted @ 2017-12-10 21:51 poorpool 阅读(269) 评论(0) 推荐(0)
摘要:不用topsort的,我也不知道为啥。 cpp include include include using namespace std; struct Node{ int fro, too; }nd[2005]; struct Edge{ int too, nxt, val; }edge[40000 阅读全文
posted @ 2017-12-08 20:18 poorpool 阅读(108) 评论(0) 推荐(0)
摘要:我们想,倘若有两个曲线u v,他们不能共存,那么连边一定是: u v' u' v v' u v u' 其中x代表x边在内侧(外侧),x'代表x边在外侧(内侧) cpp include include include using namespace std; int n, m, dfn[1005], 阅读全文
posted @ 2017-12-08 18:42 poorpool 阅读(144) 评论(0) 推荐(0)
摘要:2 SAT裸题 如果选u则必选v', 如果选v则必选u',连边即可。 cpp include include include using namespace std; struct Edge{ int too, nxt; }edge[40005]; int n, m, uu, vv, hea[160 阅读全文
posted @ 2017-12-08 15:45 poorpool 阅读(127) 评论(0) 推荐(0)