上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: 题链 线段树维护矩阵模板题 #include <bits/stdc++.h> //#pragma GCC optimize(2) using namespace std; #define LL long long #define ll long long #define ULL unsigned l 阅读全文
posted @ 2021-07-24 20:06 棉被sunlie 阅读(56) 评论(0) 推荐(0)
摘要: 题链 首先点分治; 由于求解的是小于等于k的个数,于是开一个树状数组维护前缀和即可; #include<bits/stdc++.h> using namespace std; #define LL long long #define MAXN 20009 #define MS 40009 int n 阅读全文
posted @ 2021-07-22 11:30 棉被sunlie 阅读(29) 评论(0) 推荐(0)
摘要: 题链 点分治模板题 #include<bits/stdc++.h> using namespace std; #define ll long long #define LL long long #define MAXN 9 #define MS 20009 LL n,m; struct node{ 阅读全文
posted @ 2021-07-21 14:08 棉被sunlie 阅读(35) 评论(0) 推荐(0)
摘要: 题链 单调栈非常好的讲解 #简单易懂 利用单调栈:寻找比p[i]小的下一个值的位置和上一个值的位置; #include<bits/stdc++.h> using namespace std; #define ll long long #define LL long long #define MS 3 阅读全文
posted @ 2021-07-21 12:27 棉被sunlie 阅读(36) 评论(0) 推荐(0)
摘要: 题链 点分治分为四步: 1.找到树的重心 2.删除树的重心 3.处理经过重心的路径 4.处理重心的子树 详解来自BiliBili #include<bits/stdc++.h> using namespace std; #define LL long long #define MAXN 100000 阅读全文
posted @ 2021-07-20 09:47 棉被sunlie 阅读(22) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstring> #include <iomanip> #include <algorithm> #include <queue> #include <stack> #include <vector> #include <set> #inc 阅读全文
posted @ 2021-07-19 20:51 棉被sunlie 阅读(38) 评论(0) 推荐(0)
摘要: struct node { double x,y; } p[MS]; node get_center(double x1,double y1,double x2,double y2,double x3,double y3) { double A,B,C,D,x,y,r; double x1x1 = 阅读全文
posted @ 2021-07-07 15:18 棉被sunlie 阅读(194) 评论(0) 推荐(0)
摘要: 题链 树形dp 令f[u]表示以u为根的子树需要的最小点数; 令g[u]表示以u为根的子树未被截断的点数; 对于一个点u,其孩子节点v; f[u] = $\sum_$f[v]; g[u] = $\sum_$g[v]; 若u是关键点: 则需要截断子树中未被截断的点: f[u] += g[u]; g[u 阅读全文
posted @ 2021-07-07 10:11 棉被sunlie 阅读(47) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cmath> using namespace std; #define pi acos(-1.0) typedef struct node { int x; int y; } point; double AREA(point a, double 阅读全文
posted @ 2021-06-05 18:51 棉被sunlie 阅读(61) 评论(0) 推荐(0)
摘要: vector<Pair> calc(double x1 , double y1 , double r1 , double x2 , double y2 , double r2) { x1-=x2,y1-=y2; double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S 阅读全文
posted @ 2021-06-05 18:43 棉被sunlie 阅读(122) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 12 下一页