
差分
newhonor
可以不伟大,但不能卑微
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
5028: 小Z的加油店
https://www.lydsy.com/JudgeOnline/problem.php?id=5028 思路:差分;得到差分数组a;a[i]的原值就是差分数组前缀和,所以都可以线段树处理; 总结: #include<bits/stdc++.h> using namespace std; #define sfi(i) scanf("%d",&i) #define ...原创 2019-07-13 17:16:43 · 188 阅读 · 0 评论 -
小阳的贝壳
https://ac.nowcoder.com/acm/contest/949/H 思路:线段树查询区间gcd,区间修改,差值最值 #include<bits/stdc++.h> using namespace std; #define sfi(i) scanf("%d",&i) #define sfs(i) scanf("%s",(i)) #define pri(i...原创 2019-07-13 20:07:06 · 231 阅读 · 0 评论 -
Pyramid Gym - 101981G
https://cn.vjudge.net/problem/Gym-101981G 思路:暴力处理顶点坐标;暴力数等边三角形;然后找规律; 总结:差分推公式; 最左边斜的几项0,1,2,3,3,1,0,0....是C(n,m)的系数; http://xueshu.baidu.com/s?wd=paperuri%3A%281d6cf25a905f1951b577cf287a82e1a3...原创 2019-08-15 17:50:24 · 336 阅读 · 0 评论 -
Straight Master Gym - 101775J
https://cn.vjudge.net/problem/Gym-101775J 构造差分数组,345可以组成任意大于3的数,所以b[i]大于0必然可以打出顺子; #include <iostream> #include <cstring> #include <queue> #include <vector> #include <alg...原创 2019-09-17 09:22:33 · 133 阅读 · 0 评论 -
On the way to the park Gym - 101147I
https://cn.vjudge.net/problem/Gym-101147I #include <iostream> #include <cstring> #include <queue> #include <vector> #include <algorithm> #include <cstdio> #inclu...原创 2019-09-21 11:10:00 · 339 阅读 · 0 评论