上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 55 下一页
摘要: 题意: 求$\sum_^n\sum_^m[gcd(i,j)=prime]$ 题解: 首先把$prime$换成$k$,和前几题的做法一样,可以快速推导到这一步: \(\sum_{k=1}^n\sum_{d=1}^{n/k}\mu(d)[n/kd][m/kd][k=prime]\) 然后暴力枚举每个质数 阅读全文
posted @ 2021-07-12 20:08 zlc0405 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 就在例题的基础上加个容斥。注意循环部分不要开long long ,时间会极大幅度的增长。 #include<bits/stdc++.h> using namespace std; const int maxn=1e5+100; typedef long long ll; int vis[maxn]; 阅读全文
posted @ 2021-07-12 13:32 zlc0405 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 题意: 给出$a,b,d$,求满足$1 \leq x \leq a,1 \leq y \leq b$,且$gcd(x,y)=d$的二元组$(x,y)$的数量。 \(1 \leq n \leq 5 \times 10^4\) \(1 \leq d \leq a,b \leq 5 \times 10^4 阅读全文
posted @ 2021-07-12 13:20 zlc0405 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 给出一棵树 给出m条路径 询问有多少对路径恰好在一个顶点香蕉 画图之后可以发现一个结论: 两个路径之间有交点,这个交点必定是其中一条路径的LCA。 所以,先对每条路径求LCA,称为点x。 在路径上提取出和x相邻的两个点yz,现在要求经过x不经过yz的路径条数。 画图之后发现,这个数量就是一个端点在x 阅读全文
posted @ 2021-05-30 19:07 zlc0405 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 性质: 对一个序列的或前缀和是单调不降的,每次变化至少增加一个二进制位 同时一段区间内发生变化的位置数量<=20(log值域) 那么就可以对线段树上的每个节点维护这样的一组信息: 区间内前缀或发生变化的位置以及它在区间内的前缀或 区间内后缀或发生变化的位置以及它在区间内的后缀或 一个区间内的答案数量 阅读全文
posted @ 2021-05-27 01:47 zlc0405 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 这题很妙。 多去完成这种级别的题目,建模能力才会真正得到提高。 题解干完springboot活补。 #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while 阅读全文
posted @ 2021-05-26 19:34 zlc0405 阅读(73) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while(c<'0'||c>'9') {if(c=='-') f=-1;c=getchar();} whil 阅读全文
posted @ 2021-05-24 12:28 zlc0405 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 给定数列,区间查询和,区间取模,单点修改。 #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while(c<'0'||c>'9') {if(c=='-') f 阅读全文
posted @ 2021-05-24 11:11 zlc0405 阅读(49) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while(c<'0'||c>'9') {if(c=='-') f=-1;c=getchar();} whil 阅读全文
posted @ 2021-05-23 19:27 zlc0405 阅读(49) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while(c<'0'||c>'9') {if(c=='-') f=-1;c=getchar();} whil 阅读全文
posted @ 2021-05-23 13:59 zlc0405 阅读(32) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 55 下一页