锘??xml version="1.0" encoding="utf-8" standalone="yes"?>人人狠狠综合久久88成人,亚洲国产精品无码久久久蜜芽 ,香蕉久久夜色精品国产小说http://m.shnenglu.com/y346491470/category/18660.html涓烘ⅵ鎯寵屽鏂楋紒zh-cnMon, 27 Feb 2012 02:31:47 GMTMon, 27 Feb 2012 02:31:47 GMT60poj 2728 Desert King - 鏈浼樻瘮鐜囩敓鎴愭爲 + 01鍒嗘暟瑙勫垝 + Dinkelbachhttp://m.shnenglu.com/y346491470/articles/166571.htmly @ The Angry Teletubbiesy @ The Angry TeletubbiesSun, 26 Feb 2012 08:49:00 GMThttp://m.shnenglu.com/y346491470/articles/166571.htmlhttp://m.shnenglu.com/y346491470/comments/166571.htmlhttp://m.shnenglu.com/y346491470/articles/166571.html#Feedback0http://m.shnenglu.com/y346491470/comments/commentRss/166571.htmlhttp://m.shnenglu.com/y346491470/services/trackbacks/166571.html
銆愰瑙c戯細鏈灝忔瘮鐜囩敓鎴愭爲鍜?1鍒嗘暟瑙勫垝閮芥槸浠庤繖閲屽鍒扮殑銆?br />               鏈灝忔瘮鐜囩敓鎴愭爲鐨勬ā鍨嬪叾瀹炲氨鏄?1鍒嗘暟瑙勫垝錛屽叧浜?1鍒嗘暟瑙勫垝鐨勮祫鏂欙紝緗戜笂涓澶у爢銆?br />               綆鍗曡涓嬪仛娉曪紝灝辨槸鏋勯犱竴涓?1鍒嗘暟瑙勫垝鐨勫紡瀛愶紝鐒跺悗鍙樺艦錛屽埄鐢∕ST姹傚彇褰撳墠鐨勬渶灝忓箋?br />               鐒跺悗鍒╃敤浜屽垎鎴栬匘inkelbach閫艱繎鍒版渶浼樿В鍗充負絳旀銆?br />
銆愪唬鐮併戯細
 1 #include "iostream"
 2 #include "cstdio"
 3 #include "cstring"
 4 #include "algorithm"
 5 #include "vector"
 6 #include "queue"
 7 #include "cmath"
 8 #include "string"
 9 #include "cctype"
10 #include "map"
11 #include "iomanip"
12 using namespace std;
13 #define pb push_back
14 #define lc(x) (x << 1)
15 #define rc(x) (x << 1 | 1)
16 #define lowbit(x) (x & (-x))
17 #define ll long long
18 #define maxn 1050
19 #define eps 1e-6
20 
21 int n;
22 double d[maxn][maxn];
23 int cost[maxn][maxn];
24 
25 struct Point {
26     double x, y;
27     int z;
28 }p[maxn];
29 
30 double getdist(Point &a, Point &b) {
31     return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
32 }
33 
34 int getcost(Point &a, Point &b) {
35     return abs(a.z - b.z);
36 }
37 
38 double prim(int s, double &l) {
39     double anslen = 0.0, anscost = 0.0;
40     bool visit[maxn];
41     double dist[maxn], tmp, ans = 0.0;
42     int pre[maxn];
43     for(int i = 0; i < n; i++) visit[i] = false, dist[i] = 1e30;
44     dist[s] = 0.0, pre[s] = s;
45     while(1) {
46         int u = -1;
47         for(int i = 0; i < n; i++) {
48             if(!visit[i] && (u == -1 || dist[i] < dist[u])) u = i;
49         }
50         if(u == -1) break;
51         anscost += cost[pre[u]][u];
52         anslen += d[pre[u]][u];
53         ans += dist[u];
54         visit[u] = true;
55         for(int i = 0; i < n; i++) {
56             if(!visit[i] && (tmp = 1.0 * cost[u][i] - l * d[u][i]) < dist[i])
57                 dist[i] = tmp, pre[i] = u;
58         }
59     }
60     l = anscost / anslen;
61     return ans;
62 }
63 
64 void solve() {
65     double ans= 0.0, tmp = 0.0;
66     while(1) {
67         double tmp = prim(0, ans);
68         if(fabs(tmp) < eps) break;
69     }
70     printf("%.3f\n", ans);
71 }
72 
73 int main() {
74     while(scanf("%d", &n) && n) {
75         for(int i = 0; i < n; i++) {
76             scanf("%lf%lf%d", &p[i].x, &p[i].y, &p[i].z);
77             for(int j = 0; j < i; j++) {
78                 d[i][j] = d[j][i] = getdist(p[i], p[j]);
79                 cost[i][j] = cost[j][i] = getcost(p[i], p[j]);
80             }
81         }
82         solve();
83     }
84     return 0;
85 }
86 


y @ The Angry Teletubbies 2012-02-26 16:49 鍙戣〃璇勮
]]>
poj 2976 Dropping tests - 01鍒嗘暟瑙勫垝 + Dinkelbachhttp://m.shnenglu.com/y346491470/articles/165977.htmly @ The Angry Teletubbiesy @ The Angry TeletubbiesSun, 19 Feb 2012 07:38:00 GMThttp://m.shnenglu.com/y346491470/articles/165977.htmlhttp://m.shnenglu.com/y346491470/comments/165977.htmlhttp://m.shnenglu.com/y346491470/articles/165977.html#Feedback0http://m.shnenglu.com/y346491470/comments/commentRss/165977.htmlhttp://m.shnenglu.com/y346491470/services/trackbacks/165977.html
銆愰瑙c戯細濂芥槑鏄劇殑01鍒嗘暟瑙勫垝銆?br />               璁鵑泦鍚坸[]錛寈[i]=0琛ㄧず涓嶉夌i涓猼est錛寈[i]=1琛ㄧず閫夌i涓猼est.
               鏃㈡垜浠r = (∑a[i]*x[i]) / (∑b[i]*x[i]) 鏈澶э紝涓?#8721;x[i] = k.
               鐒跺悗瑕佹瀯閫犲瓙闂錛岃緇嗙殑涓嶆兂鍐欎簡濂介夯鐑︺?br />               鏈鍚庝笂浜屽垎鎴栬卍inkelbach鍗沖彲銆?br />
銆愪唬鐮併戯細
 1 #include "iostream"
 2 #include "cstdio"
 3 #include "cstring"
 4 #include "algorithm"
 5 #include "vector"
 6 #include "queue"
 7 #include "cmath"
 8 #include "string"
 9 #include "cctype"
10 #include "map"
11 #include "iomanip"
12 using namespace std;
13 #define pb push_back
14 #define lc(x) (x << 1)
15 #define rc(x) (x << 1 | 1)
16 #define lowbit(x) (x & (-x))
17 #define ll long long
18 #define eps 1e-6
19 #define maxn 1050
20 int n, k;
21 
22 struct Point {
23     int a, b;
24     double c;
25     bool operator <(const Point &x) const {
26         return c < x.c;
27     }
28 }p[maxn];
29 
30 double work(double l) {
31     for(int i = 0; i < n; i++) p[i].c = 1.0 * p[i].a - l * p[i].b;
32     sort(p, p + n);
33     double sum = 0.0, suma = 0.0, sumb = 0.0;
34     for(int i = k; i < n; i++) sum += p[i].c, suma += p[i].a, sumb += p[i].b;
35     return suma / sumb;
36 }
37 
38 void solve() {
39     double ans = 0.0, tmp = 0.0;
40     while(1) {
41         tmp = work(ans);
42         if(fabs(tmp - ans) < eps) break;
43         ans = tmp;
44     }
45     printf("%d\n", (int)(100.0 * (tmp + 0.005)));
46 }
47 
48 int main() {
49     while(~scanf("%d%d", &n, &k)) {
50         if(!n && !k) break;
51         for(int i = 0; i < n; i++) scanf("%d", &p[i].a);
52         for(int i = 0; i < n; i++) scanf("%d", &p[i].b);
53         solve();
54     }
55     return 0;
56 }
57 


y @ The Angry Teletubbies 2012-02-19 15:38 鍙戣〃璇勮
]]>
国产高潮国产高潮久久久91 | 国产亚洲色婷婷久久99精品| 久久久无码精品亚洲日韩蜜臀浪潮| 天天影视色香欲综合久久| 2020国产成人久久精品| 国产成人精品综合久久久久| 伊人色综合久久| 九九精品久久久久久噜噜| 亚洲国产精品无码久久| 国产亚洲美女精品久久久| 无码国内精品久久人妻| 日本精品久久久久中文字幕| 亚洲精品乱码久久久久久蜜桃图片| 久久人人爽爽爽人久久久| 久久人妻少妇嫩草AV蜜桃| 国产精品久久久久久久久| 97超级碰碰碰久久久久| 午夜精品久久久久久影视777| 久久久无码人妻精品无码| 亚洲AV成人无码久久精品老人| 婷婷久久综合九色综合98| 亚洲中文字幕无码久久精品1| 97超级碰碰碰碰久久久久| 久久精品99久久香蕉国产色戒| 欧美性大战久久久久久| 国产亚州精品女人久久久久久 | 91久久精品国产免费直播| 亚洲av成人无码久久精品| 久久久久久久波多野结衣高潮| 久久精品中文字幕一区| 亚洲第一永久AV网站久久精品男人的天堂AV | 日韩久久久久久中文人妻| 亚洲精品无码专区久久同性男 | 久久久精品国产sm调教网站| 亚洲欧洲久久av| 香蕉久久夜色精品国产尤物| 午夜精品久久久久| 婷婷久久综合| 久久综合亚洲色一区二区三区| 亚洲午夜福利精品久久| 漂亮人妻被中出中文字幕久久|