上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页
摘要: 前置技能:poj3041 如果是二维平面有一些方块,这些方块被染了黑色,你每次可以选择 $(x,y)$ 的区域染成白色,代价是 $\min(x,y)$,问你付出的最小代价 显然我们不会这么染 因为这样我们的代价是 $\min(x,y)$,为了研究的方便我们假设 $x$ 比 $y$ 小,那我们就相当于 阅读全文
posted @ 2018-01-19 10:55 poorpool 阅读(185) 评论(0) 推荐(0)
摘要: 二分图。对于每个点,将他的 x 与 y 连一条边,求最小点覆盖 二分图最小点覆盖等于最大匹配 include include include using namespace std; int n, k, hea[505], cnt, lnk[1005], ans, uu, vv; bool vis[ 阅读全文
posted @ 2018-01-19 09:13 poorpool 阅读(102) 评论(0) 推荐(0)
摘要: ```cpp include include include using namespace std; int n, e[10005][2], lnk[20005], d, ans[10005]; bool vis[20005]; bool dfs(int x){ for(int i=0; i n; 阅读全文
posted @ 2018-01-19 07:50 poorpool 阅读(117) 评论(0) 推荐(0)
摘要: 维护区间左颜色值,右颜色值,颜色段个数。 cpp include include using namespace std; int n, m, uu, vv, ww, w[100005], wt[100005], qwq, idx[100005], hea[100005]; int cnt, dep 阅读全文
posted @ 2018-01-18 21:18 poorpool 阅读(132) 评论(0) 推荐(0)
摘要: 关于空间,第零棵树是 $4n$,其后每棵树都要多来 $\log(n)$ 的空间,所以我是开 $n(4+\log(n))$ 的空间。 关于借用节点: 图片来自 "这里" cpp include include include using namespace std; int n, m, rot[200 阅读全文
posted @ 2018-01-18 16:43 poorpool 阅读(169) 评论(0) 推荐(0)
摘要: 题解看 "这里" cpp include include include using namespace std; int t, maxp, w, dp[2005][2005], qaq[2005], haq, taq, ap, bp, as, bs, ans; int main(){ cin t 阅读全文
posted @ 2018-01-18 09:04 poorpool 阅读(123) 评论(0) 推荐(0)
摘要: 和「理想的正方形」比较相似,需要先掌握那道题。 花坛外头每一边必须套上绿化带 cpp include include using namespace std; int n, m, a, b, c, d, qwq[1005], twq, hwq, zzxz[1005][1005], ans; int 阅读全文
posted @ 2018-01-17 19:36 poorpool 阅读(181) 评论(0) 推荐(0)
摘要: 先对于每一行中长度为 n 的列用单调队列搞出它们的最小/大值,再将这些长度为 n 的列想象成点再对行跑一遍 cpp include include include using namespace std; int a, b, n, r[1005][1005], qwq[1005], qaq[1005 阅读全文
posted @ 2018-01-17 16:36 poorpool 阅读(106) 评论(0) 推荐(0)
摘要: 神题,还不太清楚 cpp include include include include using namespace std; int n, m, hea[1005], cnt, uu, vv, ww, minCost, pre[1005], dis[1005], ss, tt; const i 阅读全文
posted @ 2018-01-17 10:52 poorpool 阅读(109) 评论(0) 推荐(0)
摘要: 修车加强版 边跑边加,有个师傅做到第 i 个(相对他自己而言),就给他加到 i+1 个。 cpp include include include include using namespace std; int n, m, p, ss, tt, uu, hea[85005], cnt, tim[45 阅读全文
posted @ 2018-01-16 20:17 poorpool 阅读(125) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页