
2-sat
七九河开
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CDQ分治
题目https://vjudge.net/problem/Gym-100247K代码#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 2e5+10000;struct node{ int a,b,c,ans;}a[maxn],tmp[m...原创 2019-10-25 20:57:42 · 156 阅读 · 0 评论 -
Illumination Gym - 101201F (2-sat)
题目https://vjudge.net/problem/Gym-101201F题意给你n个点 问你能不能符合条件条件: 1 每个点选择行或列 会照亮左右或上下r个格子 2 某个点不能被两个同行或同列灯照亮思路2-sat模板题#include <bits/stdc++.h>using namespace std;const in...原创 2019-10-08 16:25:04 · 228 阅读 · 0 评论 -
2-sat 模板
int dfn[maxn],low[maxn];int vis[maxn],col[maxn];int sta[maxn];int color,cnt,tot;int n,m;void tarjan(int u) //模板{ cnt++; dfn[u]=low[u]=cnt; vis[u]=1; sta[++tot]=u; for(int i...原创 2019-10-08 15:57:00 · 152 阅读 · 0 评论