/**
[最短路] hud 3832 Earth Hour
这是一道求最短路的题,没看别人解题报告真是没想到呢。这分明是想法题
图上有N个圆,求最多可以删多少圆保证前三个圆是联通的。
相交圆建边构成图后,求保证三个圆联通的最少保留圆。
圆已经看成了点,最后连线肯定是一棵树,考虑树的形状,
三点要么在一条线上,要么是三叉的,枚举叉点。
*/
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
#define N 202
#define INF 100000000
vector<int> g[N];
int vis[N],d1[N],d2[N],d3[N],n,stk[N];
struct circle
{
int x,y,r;
void input()
{
scanf("%d%d%d",&x,&y,&r);
}
}cir[N];
bool cross(circle a,circle b)
{
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) <= (a.r + b.r) * (a.r + b.r);
}
void spfa(int *d,int src)
{
memset(vis,0,sizeof(vis));
fill(d,d + n,INF);
d[src] = 0;
int tp = 1;
stk[0] = src;
int u,i,v;
while(tp)
{
u =
[最短路] hud 3832 Earth Hour
最新推荐文章于 2021-01-27 20:57:23 发布