锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲综合婷婷久久,jizzjizz国产精品久久,久久综合成人网http://www.shnenglu.com/doer-xee/category/12385.htmlOne step and One step...zh-cnMon, 07 Dec 2009 15:25:14 GMTMon, 07 Dec 2009 15:25:14 GMT60PKU 鏈鐭礬棰樼洰 灝忕粨銆愪笉鏂洿鏂頒腑...銆?/title>http://www.shnenglu.com/doer-xee/archive/2009/12/05/102608.html瑗塊钀х憻瑗塊钀х憻Sat, 05 Dec 2009 09:10:00 GMThttp://www.shnenglu.com/doer-xee/archive/2009/12/05/102608.htmlhttp://www.shnenglu.com/doer-xee/comments/102608.htmlhttp://www.shnenglu.com/doer-xee/archive/2009/12/05/102608.html#Feedback0http://www.shnenglu.com/doer-xee/comments/commentRss/102608.htmlhttp://www.shnenglu.com/doer-xee/services/trackbacks/102608.html鏄傝吹鐨勮仒紺?http://acm.pku.edu.cn/JudgeOnline/problem?id=1062
A Walk Through the Forest http://acm.hdu.edu.cn/showproblem.php?pid=1142 "He considers taking a path from A to B to be progress if there exists a route from B to his home that is shorter than any possible route from A." 閲嶅湪鐞嗚В榪欏彞璇濄傚厛姹傚嚭鎵鏈夐《鐐瑰埌欏剁偣2鐨勬渶鐭礬(浠ラ《鐐?涓烘簮鐐瑰仛涓嬈ijkstra)錛岀劧鍚庝粠欏剁偣1寮濮嬭蹇嗗寲鎼滅儲(chǔ)銆?br>If (d[u] > d[v]) Sum += bfs(v);
Minimum Transport Cost http://acm.hdu.edu.cn/showproblem.php?pid=1385 Floyd璺緞杈撳嚭錛岄鐩鎸夎礬寰勭殑瀛楀吀搴忚緭鍑猴紱 if (p[i][k] + p[k][j] == map[i][j] && path[i][k] < path[i][j]) path[i][j] = path[i][k]; 鍗沖彲
Arbitrage http://acm.hdu.edu.cn/showproblem.php?pid=1217 闂鏄槸鍚﹀彲浠ョ泩鍒╋紝濡傛灉鎴戜滑鎶婃眹鐜囩湅鎴愯竟錛屽綋涓涓偣閫氳繃鏌愪簺璺緞榪斿洖鍒拌嚜宸卞悗鐨勫煎ぇ浜?錛屽垯鐩堝埄錛?br> A strange lift http://acm.hdu.edu.cn/showproblem.php?pid=1548 鍥犱負(fù)杈圭殑鏉冨奸兘涓?錛孊FS錛孌ijkstra閮藉彲浠?br>
]]>鐭╅樀鐨勫揩閫熸瘮杈?HDU2807 The Shortest Pathhttp://www.shnenglu.com/doer-xee/archive/2009/12/04/102503.html瑗塊钀х憻瑗塊钀х憻Fri, 04 Dec 2009 01:05:00 GMThttp://www.shnenglu.com/doer-xee/archive/2009/12/04/102503.htmlhttp://www.shnenglu.com/doer-xee/comments/102503.htmlhttp://www.shnenglu.com/doer-xee/archive/2009/12/04/102503.html#Feedback5http://www.shnenglu.com/doer-xee/comments/commentRss/102503.htmlhttp://www.shnenglu.com/doer-xee/services/trackbacks/102503.htmlhttp://acm.hdu.edu.cn/showproblem.php?pid=2807
#include <iostream> usingnamespace std; #define N 81 #define INF 99999999 int map[N][N], n, m; struct node{ int Map[N][N]; } rec[N];
struct nnode{ int Map[N]; }recone[N];
void cmp(int a, int x) { int i; for (i=1; i<=m; i++) if (recone[x].Map[i] != recone[0].Map[i]) return; map[a][x] =1; }
void creat(int a, int b) { int i, j, k, s; for (i=1; i<=m; i++) { recone[0].Map[i] =0; for (j=1; j<=m; j++) { recone[0].Map[i] += rec[a].Map[i][j] * recone[b].Map[j]; } }
for (i=1; i<=n; i++) if (i != a && i != b) cmp(a, i); //鍒ゆ柇 a 涓?nbsp;i鐨勫叧緋?/span> }
int main() { int i, j, k; while (scanf("%d %d", &n, &m), n+m) { for (i=1; i<=n; i++) for (map[i][i]=0, j=i+1; j<=n; j++) map[i][j] = map[j][i] = INF; //鍒濆鍖栫煩闃典箣闂村叧緋?/span> for (k=1; k<=n; k++) { for (i=1; i<=m; i++) { recone[k].Map[i] =0; for (j=1; j<=m; j++) { scanf("%d", &rec[k].Map[i][j]); recone[k].Map[i] += rec[k].Map[i][j] * j; // 2->1 } } } // 鎺ュ彈鐭╅樀淇℃伅 for (i=1; i<=n; i++) for (j=1; j<=n; j++) if (i != j) creat(i, j); // 澶勭悊鐭╅樀 i*j for (k=1; k<=n; k++) for (i=1; i<=n; i++) for (j=1; j<=n; j++) if (map[i][k] + map[k][j] < map[i][j]) map[i][j] = map[i][k] +map[k][j]; scanf("%d", &m); while (m--) { scanf("%d %d", &i, &j); if (map[i][j] != INF) printf("%d\n", map[i][j]); else printf("Sorry\n"); } } return0; }