摘要: 建议看看 "王知昆dalao的论文" ,讲得很好 cpp include include include include using namespace std; int l, w, n, ans=0, sh, xi, ma; struct Node{ int x, y; }nd[5105]; bo 阅读全文
posted @ 2017-12-13 10:48 poorpool 阅读(129) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include using namespace std; int n, x; double a[55][55]; const double eps=1e 7; void gauss(){ for(int i=1; ia[maxi][i]) maxi = 阅读全文
posted @ 2017-12-12 20:17 poorpool 阅读(199) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include using namespace std; int n, x; double a[105][105]; bool gauss(){ for(int i=1; ifabs(a[maxi][i])) maxi = j; if(f 阅读全文
posted @ 2017-12-12 09:16 poorpool 阅读(167) 评论(0) 推荐(0) 编辑
摘要: upd:现在推荐使用一个长度为 $n$ 的一维向量。若状态矩阵 $F$ 对下一时间的状态矩阵 $F'$ 有影响,则 $F'=FA$ 中的 转移矩阵 $A$ 的赋值方法是: 若状态矩阵中的第 $x$ 个数对下一单位时间的状态矩阵的第 $y$ 个数有影响,则将转移矩阵的第 $x$ 行第 $y$ 列赋值为 阅读全文
posted @ 2017-12-11 18:30 poorpool 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include using namespace std; typedef long long ll; ll k; const ll mod=1e9+7; struct Matrix{ int n; ll num[105][105]; Matrix operator (c 阅读全文
posted @ 2017-12-11 11:18 poorpool 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 学习建图 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 阅读(219) 评论(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 阅读(103) 评论(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 阅读(135) 评论(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 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 搞上一棵AC自动机,想让它无限匹配,dfs找环即可 cpp include include include include using namespace std; int n, len; char a[30005]; queue d; bool vis[30005], tmp[30005]; st 阅读全文
posted @ 2017-12-07 19:39 poorpool 阅读(112) 评论(0) 推荐(0) 编辑