随笔分类 -  数据结构

摘要:#list ##List是stl实现的双向链表,与向量(vectors)相比, 它允许快速的插入和删除,但是随机访问却比较慢。 List #vector ##注意vector内存释放 vector 由于vector的内存占用空间只增不减,比如你首先分配了10,000个字节,然后erase掉后面9,9 阅读全文
posted @ 2022-04-21 11:18 warmhearthhh 阅读(35) 评论(0) 推荐(0) 编辑
摘要:树上求和 https://ac.nowcoder.com/acm/problem/19428 #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; const int MOD=23333; #define ll lon 阅读全文
posted @ 2021-10-06 00:00 warmhearthhh 阅读(37) 评论(0) 推荐(0) 编辑
摘要:LCA LCA ver1 int LCA(int u, int v) { if (D[u] < D[v])swap(u, v);//保证D[u]>D[v] //2^L 是不小与树的高度的最小的2的幂,其中L=ceil(log2(n)); for (int h = L; h >= 0; h--)//让 阅读全文
posted @ 2021-10-05 23:58 warmhearthhh 阅读(103) 评论(0) 推荐(0) 编辑

🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.