随笔分类 - 2-Sat
摘要:namespace TwoSat { const int N = 2007; int dfn[N << 1], low[N << 1], belong[N << 1], idx; int in[N << 1], ou[N << 1], stk[N << 1], top; int ans[N], scc_cnt, sign, n; vector<int> G[N << 1]; void init(i
阅读全文
摘要:题目大意:给你 m 个式子, 问你最少再添加多少式子能使没有任何一种赋值方式使全部的式子为真。 并且在你给的式子中不能有非。 思路:根据题目给的m个式子可以建出2-Sat的图, 现在问你最少加多少个边使得2-Sat不成立, 我们可以发现我们给出的式子肯定是 a | a 的形式, 在题目中没有 ~p
阅读全文