摘要:
前置知识 treap是由BST和heap组合而成的数据结构,这一点也体现在它的名字上:treap=tree+heap BST中,每个节点的左儿子都比它小,右儿子都比它大,可以实现有序的遍历,但是可能因为数据特殊的排列方式,而退化为线性 heap中,每个父节点都是当前子树内权值最大(或最小)的点。 在 阅读全文
摘要:
Lv0.环境配置 因为win11默认开启的VBS会导致在游戏等高负载场景显卡占用异常,但是win11又已经关闭了单独关闭vbs同时保留hyperv的通道,所以只能选择一劳永逸地将hyperv关闭。这样一来,windows宿主机就无法使用docker环境了,只能把docker安装在linux虚拟机当中 阅读全文
摘要:
对于一个区间,要么一次全部删除,要么先删除左边,再删除右边 #include<bits/stdc++.h> using namespace std; const int N=110; int n,f[N][N]; int main() { scanf("%d",&n); for(int i=1;i< 阅读全文
摘要:
RT 阅读全文
摘要:
STL优先队列写法 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int n,ne[N]; struct node{ int val,pos; bool operator < (const node &G) const 阅读全文
摘要:
vector<int> alls; // 存储所有待离散化的值 sort(alls.begin(), alls.end()); // 将所有值排序 alls.erase(unique(alls.begin(), alls.end()), alls.end()); // 去掉重复元素 // 二分求出x 阅读全文
摘要:
http://noip.ybtoj.com.cn/contest/19/problem/3 这道题仍然可以用例题逃离噩梦的思路来解决。 #include<bits/stdc++.h> #define x first #define y second using namespace std; type 阅读全文
摘要:
这道题的难点在于如何判断在某个时刻巨龙能否打中猎物,如果每一次巨龙走完都要check一次效率太低,而注意到猎物是不动的,我们可以初始化出能打中猎物的点,只要巨龙移动到这些位置,就完成搜索。 #include<bits/stdc++.h> #define x first #define y secon 阅读全文
摘要:
这道题的数据是不是有点水?还是题目描述有问题? #include<bits/stdc++.h> #define x first #define y second using namespace std; const int N=1005; typedef pair<int,int> PII; int 阅读全文