06 2020 档案

摘要:题意 对于区间,我们求出[1,b]\(\)[1,a1]的即可。 求[1,n]的答案: ans=i=1nj=1n[ijgcd(i,j)n] \(=\sum\limits 阅读全文
posted @ 2020-06-08 19:55 nofind 阅读(139) 评论(0) 推荐(0) 编辑
摘要:题意 考虑转化下f(S): 我们考虑Sfail树上的每一个点x,如果x0的路径上有cnt个点(除去x0),那么就会对f(S)产生cnt的贡献,于是现在f(S)变为了每个点会对很多点产生1的贡献,最后求和。 我们知道每个点代表一个前缀,那么我们 阅读全文
posted @ 2020-06-08 19:48 nofind 阅读(157) 评论(0) 推荐(1) 编辑
摘要:题意 我们知道一个结论:gcd(fx,fy)=fgcd(x,y)。 证明见这里。 于是我们考虑将lcmgcd方向化,我们知道lcm是给指数取maxgcd是给指数取min,因此考虑minmax容斥: \(lcm(S)=\prod\li 阅读全文
posted @ 2020-06-05 19:43 nofind 阅读(201) 评论(1) 推荐(0) 编辑
摘要:题意 先枚举一个点必须选,设该点为x。 将两棵树都以x为根,对于点y,如果选y必须要选fay,于是就变成了了最大权闭合子图。 code: #include<bits/stdc++.h> using namespace std; const int maxn=55; const 阅读全文
posted @ 2020-06-05 19:40 nofind 阅读(126) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-06-05 16:33 nofind 阅读(0) 评论(0) 推荐(0) 编辑
摘要:题意 考虑点分治来枚举树上联通块,对于一个联通块,我们做有依赖性的树形DP即可,需要用单调队列优化多重背包。 有依赖性的树形DP code: #include<bits/stdc++.h> using namespace std; const int maxn=510; const int maxm 阅读全文
posted @ 2020-06-05 14:28 nofind 阅读(122) 评论(0) 推荐(0) 编辑
摘要:题意 我们先换种方式说一下kFx,y: 对于叶子点对(x,y),设其lcaz。 我们对z也进行赋值,na<nb0,反之则为1。 那么kFx,y其实就是如果x/yz的值相同,那么就会产生Fx,y的代价。 于是我们现在变成了点的代价 阅读全文
posted @ 2020-06-04 21:01 nofind 阅读(122) 评论(0) 推荐(0) 编辑
摘要:题意 算是第一道辛普森积分的题吧,这里有篇洛谷题解相当详细,这里就不赘述了。 code: #include<bits/stdc++.h> using namespace std; const int maxn=1010; const double eps=1e-7; int n; double al 阅读全文
posted @ 2020-06-04 15:04 nofind 阅读(145) 评论(0) 推荐(0) 编辑
摘要:题意 二分半径,递归判断当前矩形是否能被覆盖。 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{ 阅读全文
posted @ 2020-06-04 11:07 nofind 阅读(134) 评论(0) 推荐(0) 编辑
摘要:题意 将[l,r]离线差分一下就变成了哈希冲突那道题了。 code: #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; const int maxa=10010; const int maxt=150; int 阅读全文
posted @ 2020-06-04 10:23 nofind 阅读(82) 评论(0) 推荐(0) 编辑
摘要:题目描述 小 H 是一位优秀的越野赛车女选手。现在她准备在 A 山上进行赛车训练。 A 山上一共有 n 个广场,编号依次为 1 到 n,这些广场之间通过 n−1 条双向车道直接或间接地连接在一起。对于每条车道 i,可以用四个正整数 ui,vi,li,ri 描述,表示车道连接广场 ui 和 vi,其速 阅读全文
posted @ 2020-06-04 10:05 nofind 阅读(173) 评论(0) 推荐(0) 编辑
摘要:题意 首先联通块个数等于总点数-生成森林的边数,于是我们考虑维护原图的一棵生成树。 将边依次加入,用lct维护时间的最大生成树,并记录每条边在哪条边加入时删去,没被删则为0,设为fi。 考虑一次询问,我们查询下[l,r]fir的数的个数,这样我们就能知道这个 阅读全文
posted @ 2020-06-04 08:57 nofind 阅读(152) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-06-03 15:20 nofind 阅读(1) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示