随笔分类 - 数据结构
2022年中国大学生程序设计竞赛女生专场 ACEGHIL
摘要:2022年中国大学生程序设计竞赛女生专场 目录2022年中国大学生程序设计竞赛女生专场概况 A - 减肥计划C - 测量学E - 睡觉G - 排队打卡H - 提瓦特之旅I - 宠物对战L - 彩色的树 概况 因为女生赛,要给女队找找题,我又试了下2022女生赛,题目很多小细节需要注意,不然会wa很多
阅读全文
2022 International Collegiate Programming Contest, Jinan Site MKAEDGC
摘要:2022 International Collegiate Programming Contest, Jinan Site 目录2022 International Collegiate Programming Contest, Jinan SiteVP概况M - Best Carry Player
阅读全文
Educational Codeforces Round 6 A - E
摘要:# [Educational Codeforces Round 6](https://codeforces.com/contest/620) [TOC] ## [A - Professor GukiZ's Robot](https://codeforces.com/contest/620/probl
阅读全文
Educational Codeforces Round 23 A - F
摘要:# [Educational Codeforces Round 23](https://codeforces.com/contest/817) [TOC] ## [A - Treasure Hunt](https://codeforces.com/contest/817/problem/A) 往四个
阅读全文
Educational Codeforces Round 15 A - E
摘要:# [Educational Codeforces Round 15](https://codeforces.com/contest/702) [TOC] ## [A - Maximum Increase](https://codeforces.com/contest/702/problem/A)
阅读全文
Codeforces Round 894 (Div. 3) ABCDEFG AK
摘要:# [Codeforces Round 894 (Div. 3)](https://codeforces.com/contest/1862)  字符串替换 ```c++ void solve() { string s; cin>>s; int n =
阅读全文
2023/8/9~2023/8/11 做题
摘要:# 2023/8/9~2023/8/11 做题 [TOC] ## [Codeforces Round 121 (Div. 1) C. Fools and Roads](https://www.luogu.com.cn/problem/CF191C) 树形dp + LCA 先预处理LCA,将边下放到点
阅读全文
AcWing,第110场周赛 智商药
摘要:## [AcWing,第110场周赛 智商药](https://www.acwing.com/problem/content/5049/) UPD:2023/7/5发现维护 $dp_r = \sum_{i = l}^{r - 1}dp_i$ 直接用前缀和就可以了,不需要上树状数组和线段树。 tag:
阅读全文
AcWing,第108场周赛 拼接数组
摘要:## [AcWing,第108场周赛 拼接数组](https://www.acwing.com/problem/content/description/5043/) 前置知识:[P1115 最大子段和](https://www.luogu.com.cn/problem/P1115) 的dp和线段树作
阅读全文
AtCoder Beginner Contest 302 ABCDEF
摘要:[AtCoder Beginner Contest 302](https://atcoder.jp/contests/abc302)  tag:栈模拟 发现自己隔了快半年再做此题看错相同数字的球消失的条件,不是 $k \geq 2$ 而是 $k = a_i$ ~~电子竞技不需要视力~~
阅读全文
AtCoder Beginner Contest 304 ABCDEF
摘要:[AtCoder Beginner Contest 304](https://atcoder.jp/contests/abc304)  { ll x,y; cin>>x>>y; bool ok = false; ll z = x * 1000 - y; for(ll a = 0; a <= 1000000; a++) { ll t = a * 1000 - z; if(t
阅读全文
Chemistry Experiment Codeforces Round 247 (Div. 2) 线段树动态开点,二分
摘要:第一次写的时候还不会线段树的动态开点,写了一个是线段树但是是$O(N^2)$的写法,现在用动态开点武装了自己,会了正解$O(qlog n^2)$。首先建立一个权值线段树,但这里的权值很大,通过动态开点去建树来节省空间,对于两种操作: 操作1,常见的动态开点的单点修改 操作2,二分答案,然后在线段树上
阅读全文
区间不同数的个数 二维数点(离线) 扫描线(离线) 可持久化线段树(在线)
摘要:[SDOI2009] HH的项链 按时间先后顺序对应:二维数点(离线) 扫描线(离线) 可持久化线段树(在线) 写的比较粗糙,偏主观理解 二维数点,对于询问的$[l, r]$区间我们只需要统计有多少个数上一次出现的位置$pos$ 满足$pos \leq l$,即可。 template<class T
阅读全文
可持久化线段树模板 区间第k小数,区间前k大数之和
摘要:第K小数 // AC one more times #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define endl '\n' #def
阅读全文
权值线段树模板
摘要:【模板】普通平衡树 // AC one more times #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define endl '\n'
阅读全文