06 2021 档案

摘要:#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 阅读(62) 评论(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 阅读(127) 评论(0) 推荐(0)
摘要:前置 struct point { //存储点 double x,y; }; double cross(double x1,double y1,double x2,double y2){ //计算叉积 return (x1*y2-x2*y1); } double compare(point a,po 阅读全文
posted @ 2021-06-05 18:40 棉被sunlie 阅读(135) 评论(0) 推荐(0)
摘要:#include <bits/stdc++.h> using namespace std; inline __int128 read() { __int128 x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-') f=-1; 阅读全文
posted @ 2021-06-05 18:33 棉被sunlie 阅读(151) 评论(0) 推荐(0)
摘要:题链 退火法 #include <iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define eps 1e-7 #define MS 50 using namespace std; 阅读全文
posted @ 2021-06-05 18:20 棉被sunlie 阅读(26) 评论(0) 推荐(0)
摘要:题链 #include<bits/stdc++.h>//O(n),最小圆覆盖 #define eps 1e-12 using namespace std; int n,m; struct node { double x, y; } s[500005]; node o;//圆心坐标 double ri 阅读全文
posted @ 2021-06-05 18:11 棉被sunlie 阅读(40) 评论(0) 推荐(0)
摘要:题链 先求出每两个点的距离,再根据已有的边,将其赋值为0,然后跑一遍最小生成树; Kruskal #include <bits/stdc++.h> using namespace std; #define ls rt<<1 #define rs rt<<1|1 #define LL long lon 阅读全文
posted @ 2021-06-04 20:44 棉被sunlie 阅读(74) 评论(0) 推荐(0)
摘要:题链 树剖板题 #include <bits/stdc++.h> using namespace std; #define ls rt<<1 #define rs rt<<1|1 #define LL long long #define PI acos(-1.0) #define eps 1e-8 阅读全文
posted @ 2021-06-04 19:29 棉被sunlie 阅读(55) 评论(0) 推荐(0)
摘要:题链 树链剖分模板题,注意ai数据范围就好 //#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; #define ls rt<<1 #define rs rt<<1|1 #defin 阅读全文
posted @ 2021-06-04 18:13 棉被sunlie 阅读(37) 评论(0) 推荐(0)
摘要:题链 --解法一 跑一边dfs序,按照权值大小对n个点从大到小排好遍历,对于第i个点只要求它子树的和就行; #include <bits/stdc++.h> using namespace std; #define ls rt<<1 #define rs rt<<1|1 #define LL lon 阅读全文
posted @ 2021-06-03 22:15 棉被sunlie 阅读(50) 评论(0) 推荐(0)
摘要:题链 求其前缀和,对于每一个i,可选值的范围是[i+L-1,i+R-1],假设选了pos,那么得到的贡献就是a[pos]-a[i-1],也就是说需要选择前m大的值相加; 如果对于一个i,我在它可选值范围内选了pos,得到贡献后,对于i的下一个最大值可能在[i-L+1,pos-1]内,或者[pos+1 阅读全文
posted @ 2021-06-03 18:12 棉被sunlie 阅读(67) 评论(0) 推荐(0)
摘要:题链 题意:判断序列能否选择c个数字同时-1并执行s次,操作单点修改; 对于序列中>=s的数字,相当于那些数字就等于s,毕竟执行s次也不会把这些数字删成0; 结论就是八那些超过s的数字看作s,如果序列的总和>=c*s的话,就是可行的,否则不可行; 把每个数想象成不同颜色的楼房,比如 7 9 3 2 阅读全文
posted @ 2021-06-02 18:28 棉被sunlie 阅读(70) 评论(0) 推荐(0)
摘要:题链 可将询问按L从小到大排序,每次将序列中花朵第二次出现的位置置为1,用树状数组维护; --树状数组 //#include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <ctime> #include <cma 阅读全文
posted @ 2021-06-02 17:13 棉被sunlie 阅读(55) 评论(0) 推荐(0)
摘要:题链 随即确定一个点,将其他点对该点产生的力正交分解,试能越小越稳定; #include <bits/stdc++.h> using namespace std; #define ls rt<<1 #define rs rt<<1|1 #define LL long long #define PI 阅读全文
posted @ 2021-06-01 17:00 棉被sunlie 阅读(100) 评论(0) 推荐(0)