最近点对三个点版,做法一样的 #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; const int N=2e5+10; struct P{ double x,y; }p[N],q[N]; double dis(P a,P b){ return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);...
拒绝线段树 如果堆中没有元素或比堆顶小,直接加入当前元素,否则删除堆顶,插入两个当前元素 一个代表在当前情况下升值,即不选在堆顶卖,选择在当前位置卖,另一个则是让他可以购买 #include<bits/stdc++.h> using namespace std; typedef long long LL; multiset<int> sk; int main() { int n; LL ans = 0; cin>>n; for(int i=0; ...
#gallery-1 { margin: auto; } #gallery-1 .gallery-item { float: left; margin...

LiangJi
gplt:简单的打不顺,困难的打不来
妙啊 将区域分成左右两块,分别求最短距离d 后求跨区域的距离,一个点的上方最多能有六个点和他的垂直距离水平距离>=d 否则某个半平面内一定存在两个点距离小于d 然后就只用求6个点了 (数据有点水啊,明显错误的算法都能过 绝了 #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; const int N=1e6+10; struct ...
硬盒爽片,爽到

打标记的线段树 #include <iostream> #include <cstdio> using namespace std; const int N=5e5+10; int w[N]; bool flag[N]; int n,m; void change(int x,int l,int r){ flag[x]^=1; w[x]=r-l+1-w[x]; } void pushdown(int x,int l,int r){ if(flag[x]){ ...

#include <bits/stdc++.h> using namespace std; const int N = 1010; int n,cnt,tot; struct P { double x, y; P(double _x = 0, double _y = 0) { x = _x; y = _y; } friend P operator -(P a, P b) { return P(a.x - b.x, a.y - b.y); } friend double operator *(P a...
网络流复活 最小割问题 S向第i个任务连a[i]的边,向T连b[i]的边,信息交换的从a到b连w[i]的双向边,如果a、b在两个不同的核上,该无向边一定会有流经过 #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cstring> using namespace std; const int N=4e4+10; const int M=1...