数据结构1
\(A\) luogu P5494 【模板】线段树分裂
\(B\) luogu P1637 三元上升子序列
- 题解
\(C\) luogu P6492 [COCI2010-2011#6] STEP
\(D\) luogu P6136 【模板】普通平衡树(数据加强版)
- 题解
\(E\) luogu P3038 [USACO11DEC] Grass Planting G
- 多倍经验: SP12005 GRASSPLA - Grass Planting
- 题解
\(F\) luogu P7735 [NOI2021] 轻重边
\(G\) luogu P3605 [USACO17JAN] Promotion Counting P
- 题解
\(H\) luogu P7394 「TOCO Round 1」History
\(I\) luogu P7671 [GDOI2016] 疯狂动物城
\(J\) CF915E Physical Education Lessons
- 题解
\(K\) CF19D Points
\(L\) CF193D Two Segments
\(M\) CF1983F array-value
\(N\) [ABC371F] Takahashi in Narrow Road
- 题解
\(O\) CF1304F2 Animal Observation (hard version)
\(P\) CF946G Almost Increasing Array
\(Q\) CF718C Sasha and Array
\(R\) CF1956F Nene and the Passing Game
\(S\) [ABC351G] Hash on Tree
\(T\) [ARC073F] Many Moves
\(U\) luogu P4719 【模板】"动态 DP"&动态树分治
\(V\) luogu P6348 [PA2011] Journeys
- 题解
\(W\) luogu P2605 [ZJOI2010] 基站选址
- 题解
\(X\) luogu P3521 [POI2011] ROT-Tree Rotations
- 题解
数据结构2
\(A\) luogu B3656 【模板】双端队列 1
-
用
list
代替deque
。 -
关于
deque
和list
的空间问题,详见 关于deque和list 。点击查看代码
list<int>q[1000001]; int main() {int n,i,a,x;string pd;cin>>n;for(i=1;i<=n;i++){cin>>pd;if(pd=="push_back"){cin>>a>>x;q[a].push_back(x);}if(pd=="pop_back"){cin>>a;if(q[a].empty()==0){q[a].pop_back();}}if(pd=="push_front"){cin>>a>>x;q[a].push_front(x);}if(pd=="pop_front"){cin>>a;if(q[a].empty()==0){q[a].pop_front();}}if(pd=="size"){cin>>a;cout<<q[a].size()<<endl;}if(pd=="front"){cin>>a;if(q[a].empty()==0){cout<<q[a].front()<<endl;}}if(pd=="back"){cin>>a;if(q[a].empty()==0){cout<<q[a].back()<<endl;}}}return 0; }
\(B\) luogu P1892 [BOI2003] 团伙
- 扩展域并查集。
\(C\) luogu P2502 [HAOI2006] 旅行
\(D\) luogu P3402 可持久化并查集
- 题解
\(E\) luogu P4768 [NOI2018] 归程
\(F\) luogu P5854 【模板】笛卡尔树
\(G\) luogu P2081 [NOI2012] 迷失游乐园
\(H\) luogu P4381 [IOI2008] Island
- 题解 。
\(I\) CF1713E Cross Swapping
\(J\) HDU6403 Card Game
- 题解
\(K\) luogu P6453 [COCI2008-2009#4] PERIODNI
- 多倍经验: SP3734 PERIODNI - Periodni