摘要: 每个球向可以组成的完全平方数连边,会连出一个有向无环图 柱子上的球对应图上的路径,相当于最小路径点覆盖 求出拆点二分图,再用n 最大匹配数即可 include include include include include define maxn 100000 define maxm 100000 阅读全文
posted @ 2019-01-24 15:10 birchtree 阅读(672) 评论(0) 推荐(0) 编辑
摘要: 最小路径覆盖模板题 include include include include define maxn 155 define maxm 6005 using namespace std; int n,m; struct edge{ int from; int to; int next; }E[m 阅读全文
posted @ 2019-01-24 15:08 birchtree 阅读(400) 评论(0) 推荐(0) 编辑
摘要: [luogu 2756]飞行员配对方案问题 题面 "luogu 2756" 英国飞行员为左部节点,外国飞行员为右部节点,直接跑二分图匹配即可 cpp include include include define maxn 105 using namespace std; struct edge{ i 阅读全文
posted @ 2019-01-24 15:05 birchtree 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 题面 "传送门" 分析 设dp[i]是第i个积木在自己的位置上时,前i个积木中最多能回到自己位置的数目。 $dp[i]=max(dp[j])+1 (i j,a[i] a[j],a[i] a[j]a[j]$是保证i,j都在自己的位置上,$a[i] a[j]j $ $ (2) i a[i] =j a[j 阅读全文
posted @ 2019-01-24 08:49 birchtree 阅读(138) 评论(0) 推荐(0) 编辑