摘要:
带权并查集板题 维护到根的距离 #include <iostream> #include <algorithm> #include <cstring> #include <vector> #include <queue> using namespace std; const int N =2e5+1 阅读全文
摘要:
01bfs 跑完d1 ,d2 ( 单源最短路 枚举 中间点(去掉的点 #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <map> using namespace std; con 阅读全文
摘要:
maintain block size: fa[fy]=fx; sz[fx]+=sz[fy],sz[fy]=0; 阅读全文
摘要:
:边权存储在dep较大的点,转化为点权问题 注意区间查询时,如果当前x,y在一条重链上时的情况 https://www.luogu.com.cn/problem/P1967 https://www.luogu.com.cn/problem/AT_abc294_g https://darkbzoj.c 阅读全文
摘要:
点双 找到割点后 一直退栈 http://ybt.ssoier.cn:8088/problem_show.php?pid=1521 include <iostream> #include <algorithm> #include <cmath> #include <vector> #include< 阅读全文
摘要:
for( x: iter ) x为一个pair map<int,int> mp ; signed main(){ mp[3] =4 ; mp[33] =1; for(auto xx:mp) cout << xx.first<<' '<<xx.second <<endl; } 阅读全文
摘要:
https://vjudge.net/article/2790 然后要启用开发者模式,然后就可以打开开发者工具。 (Safari–Preferences呼出首选项面板(或用快捷键 command+, 直接呼出)。 在 Advanced 菜单面板下,勾选 Show Develop Menu in me 阅读全文
摘要:
来源于 https://vjudge.net/problem/CodeForces-291E void init(int x,int fa){ val[x]=val[fa]*S+(ul)c[x]; f[x][0]= fa; for (int i=1;i<20;++i) f[x][i]=f[f[x][ 阅读全文
摘要:
。每个人都有一个考试等级,教室里面一共有N个课桌,按照顺序排成一列,每个课桌可以坐两个人,记他们的能力等级为(A[i],B[i])。 现在决定对能力等级为K的人进行测验。从这N排中选择连续的L排进行测验,要求这L排中的每一排至少有一个人考试等级为K。 现在想知道L的最大值以及对应的等级K。 #inc 阅读全文
摘要:
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct hp{ int ai,bi,ci; }a[1005]; bool cmp(hp a,hp b){ 阅读全文