锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品免费一区二区三区,久久亚洲国产精品123区,久久久综合九色合综国产http://m.shnenglu.com/gzwzm06/category/10035.htmlzh-cnTue, 31 Mar 2009 19:09:38 GMTTue, 31 Mar 2009 19:09:38 GMT60- POJ 2402- A Star not a Tree?(璐歸┈鐐?http://m.shnenglu.com/gzwzm06/articles/78449.html宸?/dc:creator>宸?/author>Tue, 31 Mar 2009 04:08:00 GMThttp://m.shnenglu.com/gzwzm06/articles/78449.htmlhttp://m.shnenglu.com/gzwzm06/comments/78449.htmlhttp://m.shnenglu.com/gzwzm06/articles/78449.html#Feedback0http://m.shnenglu.com/gzwzm06/comments/commentRss/78449.htmlhttp://m.shnenglu.com/gzwzm06/services/trackbacks/78449.html 1
#include <cstdio>
2
#include <cmath>
3
4
const int SIZE = 102;
5
6
struct TPoint
7

{
8
double x ;
9
double y ;
10
} ;
11
12
TPoint point[SIZE];
13
int N;
14
15
double Distance( const TPoint& p1, const TPoint& p2 )
16

{
17
return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)) ;
18
}
19
20
double GetALLDist( const TPoint& p, const int& n )
21

{
22
int i;
23
double sum = 0.0;
24
25
for ( i = 0; i < n; ++i )
26
sum += Distance( p, point[i] );
27
28
return sum;
29
}
30
31
double GetFermatPoint( const int& n )
32

{
33
TPoint st = point[0];
34
TPoint tmp, nt;
35
double t, step = 100, fermat = GetALLDist(st, n);
36
37
while ( step > 0.2 )
38
{
39
int ok = 1;
40
41
while ( ok )
{
42
ok = 0;
43
nt = st;
44
45
tmp.x = st.x, tmp.y = st.y + step;
46
47
t = GetALLDist(tmp, n);
48
49
if ( t < fermat )
50
{
51
fermat = t;
52
ok = 1;
53
nt = tmp;
54
}
55
56
tmp.x = st.x, tmp.y = st.y - step;
57
58
t = GetALLDist(tmp, n);
59
if ( t < fermat )
60
{
61
fermat = t;
62
ok = 1;
63
nt = tmp;
64
}
65
66
tmp.x = st.x + step, tmp.y = st.y;
67
68
t = GetALLDist(tmp, n);
69
70
if ( t < fermat )
71
{
72
fermat = t;
73
ok = 1;
74
nt = tmp;
75
}
76
77
tmp.x = st.x - step, tmp.y = st.y;
78
79
t = GetALLDist(tmp, n);
80
if ( t < fermat )
81
{
82
fermat = t;
83
ok = 1;
84
nt = tmp;
85
}
86
87
st = nt;
88
}
89
90
step /= 2.0;
91
}
92
93
return fermat;
94
}
95
96
int main()
97

{
98
int i, ans;
99
double t;
100
101
scanf("%d", &N);
102
103
for ( i = 0; i < N; ++i )
104
{
105
scanf("%lf %lf", &point[i].x, &point[i].y);
106
}
107
108
t = GetFermatPoint( N );
109
110
ans = (int)(t + 0.5) * 100 / 100;
111
112
printf("%d\n", ans);
113
114
return 0;
115
}

]]>
久久夜色撩人精品国产|
久久亚洲精品无码aⅴ大香|
亚洲精品乱码久久久久久按摩|
精品久久久久久中文字幕人妻最新|
久久午夜福利电影|
国产成人无码精品久久久性色|
久久久久国产|
国产精品gz久久久|
丰满少妇人妻久久久久久
|
久久国产成人午夜AV影院|
亚洲精品国精品久久99热一|
国产精品久久久久9999|
久久国产精品成人片免费|
久久久久久久久久久|
伊人伊成久久人综合网777|
久久av高潮av无码av喷吹|
国产美女亚洲精品久久久综合|
国产99久久九九精品无码|
久久精品aⅴ无码中文字字幕重口|
亚洲国产天堂久久综合网站
|
久久精品国产亚洲AV高清热|
久久亚洲国产精品123区|
国产成人精品白浆久久69|
婷婷久久香蕉五月综合加勒比|
久久99久久无码毛片一区二区|
97久久精品无码一区二区|
久久精品国产精品亚洲精品
|
97久久精品无码一区二区天美|
久久婷婷是五月综合色狠狠|
99久久精品国产一区二区|
亚洲国产小视频精品久久久三级
|
亚洲欧美日韩精品久久|
日韩av无码久久精品免费|
国产精品对白刺激久久久|
99精品久久精品一区二区|
久久天天躁夜夜躁狠狠躁2022|
青春久久|
久久久噜噜噜www成人网|
久久男人Av资源网站无码软件|
亚洲精品乱码久久久久久|
久久精品中文騷妇女内射|