Processing math: 100%

02 2018 档案

摘要:算法竞赛进阶指南p219,这里是分块。 当然也可以树套树来个动态二维数点。 cpp include include include include include using namespace std; typedef long long ll; int xx, yy, n, uu, vv, bl 阅读全文
posted @ 2018-02-28 20:52 poorpool 阅读(168) 评论(0) 推荐(0) 编辑
摘要:```cpp #include #include #include #include #include #include #include using namespace std; int n, m, bel[40005], a[40005], blc, f[1005][1005], cnt[40005], idx, ans; int val[40005], uu, vv; map ... 阅读全文
posted @ 2018-02-28 13:54 poorpool 阅读(158) 评论(0) 推荐(0) 编辑
摘要:大凡两个标记,无非是先乘再加,与先加再乘的区别罢了。 先加再乘 我们以 val 来表示这个结点原始的值,addmul 顾名思义是两个标记。这样,这个结点的值就被更新成了 (val+add)×mul。(其实 add 还要跟区间长度搞一搞,这里就省略了)。我们就知 阅读全文
posted @ 2018-02-25 13:30 poorpool 阅读(792) 评论(0) 推荐(1) 编辑
摘要:"hzwer的讲解" 一 给出一个长为 n 的数列,以及 n 个操作,操作涉及区间加法,单点查值。 cpp include include include include include using namespace std; int n, blc, a[50005], tag[50005 阅读全文
posted @ 2018-02-23 21:48 poorpool 阅读(440) 评论(0) 推荐(0) 编辑
摘要:可以用树状数组,线段树,分块做。代码是分块 cpp include include include using namespace std; typedef long long ll; int n, m, uu, vv, ww, blc, bel[100005]; ll sum[100005], t 阅读全文
posted @ 2018-02-23 16:45 poorpool 阅读(89) 评论(0) 推荐(0) 编辑
摘要:扫描线应该打懒标记的…… cpp include include include using namespace std; typedef long long ll; int T, n, m, w, h, cnt, uu, vv, ww, zdz[80005], ans, tag[80005]; l 阅读全文
posted @ 2018-02-23 15:18 poorpool 阅读(140) 评论(0) 推荐(0) 编辑
摘要:题目: "poj1151" 建议先参考参考别的扫描线文档。 考虑这样一些矩形: 拿一根扫描线从左往右扫,扫描线被矩形覆盖的长度会变化当扫过矩形的左右边界时。 我们就剥离出来左右边界。我们把所有的 y 值都保存下来离散化。 我们拿线段树维护扫描线。线段树结点应保存从第几个 y 开始到第几个 $ 阅读全文
posted @ 2018-02-22 17:47 poorpool 阅读(204) 评论(0) 推荐(0) 编辑
摘要:参见算法竞赛进阶指南190页 cpp include include include using namespace std; int n, m, num[10005], qwq=1, fa[10005], dis[10005]; char ss[15]; struct Node{ int l, r 阅读全文
posted @ 2018-02-21 21:09 poorpool 阅读(129) 评论(0) 推荐(0) 编辑
摘要:参见算法竞赛进阶指南77页 参考算法竞赛进阶指南188页 cpp include include include using namespace std; int n, fa[10005], ans; struct Node{ int p, d; }nd[10005]; bool cmp(Node 阅读全文
posted @ 2018-02-20 16:47 poorpool 阅读(110) 评论(0) 推荐(0) 编辑
摘要:参考 "这篇" 阅读全文
posted @ 2018-02-19 19:19 poorpool 阅读(118) 评论(0) 推荐(0) 编辑
摘要:状压搜索轻轻松松就过了……考场上代码太丑了T了几个点 cpp include include include using namespace std; int n, m, uu, vv, ww, w[15][15], dis[15], dp[100005], ans; const int oo=0x 阅读全文
posted @ 2018-02-17 21:37 poorpool 阅读(117) 评论(0) 推荐(0) 编辑
摘要:两遍 spfa 然后建立分层图拓扑排序 dp 一下。 写得很差劲。效率很低。 时间复杂度 O(Tnk)。 参见 "这里" 秒懂。 阅读全文
posted @ 2018-02-15 19:46 poorpool 阅读(108) 评论(0) 推荐(0) 编辑
摘要:先二分答案转化成判定问题。 考虑拿一根扫描线从 x=0 扫到 x=n,每次移动扫描线更新每个位置它上面的点数和下面的点数,这样可以确定在当前的扫描线上哪些位置对于 y 轴方向是合法的。对于 x 轴方向合法的点应该处的范围可以直接算出来,树状数组维护。 cpp include incl 阅读全文
posted @ 2018-02-13 21:47 poorpool 阅读(139) 评论(0) 推荐(0) 编辑
摘要:因为一个变化只会变化一个值,所以 $dp[i]=max(dp[j])+1,j include using namespace std; int n, m, zdz[100005], zxz[100005], a[100005], uu, vv, cnt, dp[100005], ans, rot[1 阅读全文
posted @ 2018-02-13 15:36 poorpool 阅读(143) 评论(0) 推荐(0) 编辑
摘要:```cpp include include include include using namespace std; int n, m, a[50005], opt, uu, vv, ww, ans; const int oo=2147483647; namespace treap{ struct 阅读全文
posted @ 2018-02-12 21:52 poorpool 阅读(162) 评论(0) 推荐(0) 编辑
摘要:```cpp include include using namespace std; int s[2000005][2], cnt, n, m, x, uu, ans, dep[2000005], siz[2000005]; void ins(){ int u=0; for(int i=19; i 阅读全文
posted @ 2018-02-11 21:12 poorpool 阅读(122) 评论(0) 推荐(0) 编辑
摘要:```cpp include include include include using namespace std; typedef long long ll; int n, m; ll a[500005], uu, vv, lst, qzh[500005]; struct SGT{ ll sum 阅读全文
posted @ 2018-02-11 17:33 poorpool 阅读(443) 评论(0) 推荐(0) 编辑
摘要:```cpp #include #include using namespace std; typedef long long ll; int n, m, T, uu, vv, ww; const int mod=1000000007; char ss[100005]; struct Matrix{ int ma[3][3]; Matrix operator * (const Matrix... 阅读全文
posted @ 2018-02-11 16:04 poorpool 阅读(110) 评论(0) 推荐(0) 编辑
摘要:差分一下上线段树 阅读全文
posted @ 2018-02-11 10:33 poorpool 阅读(138) 评论(0) 推荐(0) 编辑
摘要:11日 luogu T21778 hdu 6155 12日 luogu 3380 13日 luogu 3415 luogu 4093 15日 luogu 3593 17日 luogu 3959 19日 luogu 3960 20日 luogu 1955 poj 1456 21日 poj 1733 2 阅读全文
posted @ 2018-02-11 10:32 poorpool 阅读(121) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示