锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久777国产线看观看精品,久久久亚洲裙底偷窥综合,青青草原综合久久大伊人导航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 - 鏈浼樻瘮鐜囩敓鎴愭爲(wèi) + 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戯細(xì)鏈灝忔瘮鐜囩敓鎴愭爲(wèi)鍜?1鍒嗘暟瑙勫垝閮芥槸浠庤繖閲屽鍒扮殑銆?br />               鏈灝忔瘮鐜囩敓鎴愭爲(wèi)鐨勬ā鍨嬪叾瀹炲氨鏄?1鍒嗘暟瑙勫垝錛屽叧浜?1鍒嗘暟瑙勫垝鐨勮祫鏂欙紝緗戜笂涓澶у爢銆?br />               綆鍗曡涓嬪仛娉曪紝灝辨槸鏋勯犱竴涓?1鍒嗘暟瑙勫垝鐨勫紡瀛愶紝鐒跺悗鍙樺艦錛屽埄鐢∕ST姹傚彇褰撳墠鐨勬渶灝忓箋?br />               鐒跺悗鍒╃敤浜屽垎鎴栬匘inkelbach閫艱繎鍒版渶浼樿В鍗充負(fù)絳旀銆?br />
銆愪唬鐮併戯細(xì)
 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戯細(xì)濂芥槑鏄劇殑01鍒嗘暟瑙勫垝銆?br />               璁鵑泦鍚坸[]錛寈[i]=0琛ㄧず涓嶉夌i涓猼est錛寈[i]=1琛ㄧず閫夌i涓猼est.
               鏃㈡垜浠r = (∑a[i]*x[i]) / (∑b[i]*x[i]) 鏈澶э紝涓?#8721;x[i] = k.
               鐒跺悗瑕佹瀯閫犲瓙闂錛岃緇嗙殑涓嶆兂鍐欎簡(jiǎn)濂介夯鐑?chǔ)銆?br />               鏈鍚庝笂浜屽垎鎴栬卍inkelbach鍗沖彲銆?br />
銆愪唬鐮併戯細(xì)
 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精品国产高清91久久久久久| 久久精品九九亚洲精品天堂| 99久久国产综合精品五月天喷水| 久久久久亚洲av毛片大| 性高朝久久久久久久久久| 久久精品亚洲男人的天堂 | 久久久久久国产精品无码下载| 亚洲国产另类久久久精品| 日本免费一区二区久久人人澡| 精品一二三区久久aaa片| 97久久超碰国产精品旧版| 久久久久人妻一区精品| 潮喷大喷水系列无码久久精品| 久久久久久久免费视频| 久久精品国产亚洲网站| 久久人人爽人人人人片av| 中文精品久久久久国产网址| 77777亚洲午夜久久多喷| 亚洲va久久久久| 国产成人久久久精品二区三区| 日韩人妻无码精品久久免费一| 国产A级毛片久久久精品毛片| 日本一区精品久久久久影院| 久久久久久久久无码精品亚洲日韩 | 欧美精品福利视频一区二区三区久久久精品 | 三级三级久久三级久久| 久久久国产精品| 91精品国产91热久久久久福利| 亚洲AV无码成人网站久久精品大| 亚洲欧美久久久久9999| 亚洲午夜久久久久久久久久| 久久久久亚洲AV无码去区首| 精品久久久久久无码国产| 久久久久成人精品无码| 大美女久久久久久j久久| 久久国产精品-久久精品| 青青国产成人久久91网| 亚洲国产精品人久久| 国产成人香蕉久久久久| 久久精品成人免费国产片小草|