随笔分类 - 数据结构
摘要:题目链接:https://codeforces.com/problemset/problem/1585/F 题解: 难难难 考虑容斥:设 $A_i$ 表示 $b_i \neq b_{i+1}$ ($i=1,2,\cdots,n-1$) 时对应的 $\{b_i\}$ 方案的答案 那么答案就是 $$\b
阅读全文
摘要:题目链接:https://www.luogu.com.cn/problem/P3168 题解: 主席树可以解决一类j静态区间第 $k$ 小的[问题](https://www.luogu.com.cn/problem/P3834),我们先来看看这是怎么工作的 - 主席树的本质就是有很多棵线段树,然后发
阅读全文
摘要:题目链接:https://www.luogu.com.cn/problem/P3792 题解: 一点小小的空间震撼(ML:125MB) $ 是逆序对,$c,
阅读全文
摘要:比赛链接:https://atcoder.jp/contests/abc285 题解: ABC 水题 int a,b; scanf("%d%d",&a,&b); if(b==2*a||b==2*a+1)cout<<"Yes"; else cout<<"No"; scanf("%d",&n); sca
阅读全文
摘要:比赛链接:https://codeforces.com/contest/1743 题解: AB 水题 // by SkyRainWind #include <cstdio> #include <vector> #include <cstring> #include <iostream> #inclu
阅读全文
摘要:比赛链接:https://codeforces.com/contest/1749 题解: AB 水题 // by SkyRainWind #include <cstdio> #include <vector> #include <cstring> #include <iostream> #inclu
阅读全文
摘要:题目链接:https://www.luogu.com.cn/problem/P4315 题意:一棵有边权的树,维护树上的链加、链覆盖、修改边权、链上max 题解: 好难写... 首先把边权转化为儿子的点权 然后树链剖分,需要注意覆盖和加的先后顺序。可以这么考虑: 有一串操作,为 加 覆盖 加 覆盖
阅读全文

浙公网安备 33010602011771号