锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品xxxx国产喷水亚洲国产精品无码久久一区 ,国产综合免费精品久久久,久久ZYZ资源站无码中文动漫http://www.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://www.shnenglu.com/y346491470/articles/166571.htmly @ The Angry Teletubbiesy @ The Angry TeletubbiesSun, 26 Feb 2012 08:49:00 GMThttp://www.shnenglu.com/y346491470/articles/166571.htmlhttp://www.shnenglu.com/y346491470/comments/166571.htmlhttp://www.shnenglu.com/y346491470/articles/166571.html#Feedback0http://www.shnenglu.com/y346491470/comments/commentRss/166571.htmlhttp://www.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://www.shnenglu.com/y346491470/articles/165977.htmly @ The Angry Teletubbiesy @ The Angry TeletubbiesSun, 19 Feb 2012 07:38:00 GMThttp://www.shnenglu.com/y346491470/articles/165977.htmlhttp://www.shnenglu.com/y346491470/comments/165977.htmlhttp://www.shnenglu.com/y346491470/articles/165977.html#Feedback0http://www.shnenglu.com/y346491470/comments/commentRss/165977.htmlhttp://www.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 鍙戣〃璇勮
]]>
久久超碰97人人做人人爱| 国产精品无码久久综合| 久久精品中文字幕一区| 一级做a爰片久久毛片免费陪| 久久精品国产欧美日韩99热| 久久久婷婷五月亚洲97号色| 国产成人AV综合久久| 久久亚洲AV无码精品色午夜| av国内精品久久久久影院| 久久激情五月丁香伊人| 久久精品一本到99热免费| 久久91精品综合国产首页| 久久夜色精品国产噜噜麻豆| 狠色狠色狠狠色综合久久| 色妞色综合久久夜夜| 国内精品久久久久久久coent| 伊人久久久AV老熟妇色| 无码人妻少妇久久中文字幕| 国产午夜精品理论片久久影视 | 青青草原1769久久免费播放| 免费精品国产日韩热久久| 久久久中文字幕| 久久天天躁狠狠躁夜夜网站| 亚洲精品美女久久久久99小说| 亚洲午夜久久影院| 久久男人Av资源网站无码软件| 精品久久久久久久久免费影院| 久久综合九色综合久99| 国内精品伊人久久久久av一坑| 精品熟女少妇AV免费久久| 久久精品国产第一区二区| 久久99精品国产99久久6男男| 亚洲va久久久噜噜噜久久狠狠| 久久精品视频一| 久久这里只有精品首页| 中文精品99久久国产 | 亚洲综合熟女久久久30p| 中文字幕久久亚洲一区| 日韩一区二区三区视频久久 | 嫩草伊人久久精品少妇AV| 亚洲αv久久久噜噜噜噜噜|