摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = _____; 7 8 struct TwoSAT 9 {10 int n;11 vector G[maxn*2];12 ... 阅读全文
posted @ 2014-10-04 22:30 PlasticSpirit 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 一道2-SAT问题,每对钥匙需要加一条边,每扇门上的对应的要用的钥匙加一条边。其实求解2-SAT问题,关键在于找到不能同时成立的条件,例如在本题中,每对钥匙不能同时使用,每扇门上的钥匙不能同时不使用。 1 #include 2 #include 3 #include 4 using name... 阅读全文
posted @ 2014-10-04 22:26 PlasticSpirit 阅读(313) 评论(0) 推荐(0) 编辑