平衡树-Treap
无
DJL_DJL_DJL
程序是我的生命,但我相信爱她甚过爱我的生命。
展开
-
Acwing_265营业额统计【平衡树Treap】
题目链接:Acwing_265营业额统计思路很简单,平衡树的话可以自己手写一个或者利用set集合也可以做这个题目#include <iostream>#include <ctime>#include <cstdio>using namespace std;typedef long long LL;const int N = 34000, INF = 1e7;int n, idx, root;LL res;struct Node{ int l,原创 2021-08-19 11:23:32 · 142 阅读 · 0 评论 -
【平衡树Treap】
模板题目:Acwing_253普通平衡树代码里面有详细注释AC代码:#include <iostream>#include <algorithm>#include <cstdio>using namespace std;const int N = 100010, INF = 1e8;int n;struct Node { int l, r; // 左右儿子 int key; // 二叉搜索树权值 int val; // 大根堆的随机原创 2021-08-19 10:39:41 · 58 阅读 · 0 评论