AcWing 119. 袭击 分治

2021-03-11 11:29

阅读:408

标签:typedef   return   include   algo   const   坐标   参考   turn   struct   

参考博客:https://www.acwing.com/solution/AcWing/content/826/

//#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int N = 100100;
const int INF=1e7;
struct node
{
	double x,y;
	int f;
}a[N>1;
    if (r-l==0)
        return INF;
    if (r-l==1)
        return dist(a[l],a[r]);
    double ans=min(solve(l,mid),solve(mid+1,r));
    //交叉部分 
    int cnt=0;
    for (int i=l;i=a[mid].x-ans && a[i].x=t[i].y+ans)
                break;
            ans=min(ans,dist(t[i],t[j]));
        }
    return ans;
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		for(int i=1;i>a[i].x>>a[i].y;
			a[i].f=0;
		} 
		for(int i=n+1;i>a[i].x>>a[i].y;
			a[i].f=1;
		}
		n

AcWing 119. 袭击 分治

标签:typedef   return   include   algo   const   坐标   参考   turn   struct   

原文地址:https://www.cnblogs.com/QingyuYYYYY/p/12638298.html


评论


亲,登录后才可以留言!