06 2020 档案
摘要:题意 考虑转化下: 我们考虑的树上的每一个点,如果到的路径上有个点(除去和),那么就会对产生的贡献,于是现在变为了每个点会对很多点产生的贡献,最后求和。 我们知道每个点代表一个前缀,那么我们
阅读全文
摘要:题意 先枚举一个点必须选,设该点为。 将两棵树都以为根,对于点,如果选必须要选,于是就变成了了最大权闭合子图。 code: #include<bits/stdc++.h> using namespace std; const int maxn=55; const
阅读全文
摘要:题意 考虑点分治来枚举树上联通块,对于一个联通块,我们做有依赖性的树形DP即可,需要用单调队列优化多重背包。 有依赖性的树形DP code: #include<bits/stdc++.h> using namespace std; const int maxn=510; const int maxm
阅读全文
摘要:题意 算是第一道辛普森积分的题吧,这里有篇洛谷题解相当详细,这里就不赘述了。 code: #include<bits/stdc++.h> using namespace std; const int maxn=1010; const double eps=1e-7; int n; double al
阅读全文
摘要:题意 二分半径,递归判断当前矩形是否能被覆盖。 code: #include<bits/stdc++.h> using namespace std; const int maxn=55; const double eps=1e-6; int T,K; double n,m; struct node{
阅读全文
摘要:题意 将离线差分一下就变成了哈希冲突那道题了。 code: #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; const int maxa=10010; const int maxt=150; int
阅读全文
摘要:题目描述 小 H 是一位优秀的越野赛车女选手。现在她准备在 A 山上进行赛车训练。 A 山上一共有 n 个广场,编号依次为 1 到 n,这些广场之间通过 n−1 条双向车道直接或间接地连接在一起。对于每条车道 i,可以用四个正整数 ui,vi,li,ri 描述,表示车道连接广场 ui 和 vi,其速
阅读全文
摘要:题意 首先联通块个数等于总点数-生成森林的边数,于是我们考虑维护原图的一棵生成树。 将边依次加入,用lct维护时间的最大生成树,并记录每条边在哪条边加入时删去,没被删则为,设为。 考虑一次询问,我们查询下内的数的个数,这样我们就能知道这个
阅读全文