青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

糯米

TI DaVinci, gstreamer, ffmpeg
隨筆 - 167, 文章 - 0, 評論 - 47, 引用 - 0
數(shù)據(jù)加載中……

個(gè)人說明


關(guān)于寫博客的目的
引用一句話“如果每個(gè)程序員都寫博客,中國的技術(shù)水平就不是現(xiàn)在這個(gè)樣子”。
對,這就是我寫博客的目的。我必須盡量保證博客里的每一篇文章都清晰明了,適于閱讀,能讓他人在最短時(shí)間能獲得想要的東西。
因此我以后不會把廢話放上來,保證發(fā)表的文章都是關(guān)于技術(shù),并且有利于他人。

關(guān)于我
豆瓣:http://www.douban.com/people/nuomihaochi/

posted @ 2011-08-24 09:55 糯米 閱讀(372) | 評論 (1)編輯 收藏

lisp let,let*

let and let* create new variable bindings and execute a series of forms that use these bindings. 
let performs the bindings in parallel and let* does them sequentially.

The form

(let ((var1 init-form-1)
(var2 init-form-2)
...
(varm init-form-m))
declaration1
declaration2
...
declarationp
form1
form2
...
formn)

first evaluates the expressions init-form-1, init-form-2, and so on, in that order, saving the resulting values.
Then all of the variables varj are bound to the corresponding values;
each binding is lexical unless there is a special declaration to the contrary.
The expressions formk are then evaluated in order; the values of all but the last are discarded
(that is, the body of a let is an implicit progn).
let* is similar to let, but the bindings of variables are performed sequentially rather than in parallel.
The expression for the init-form of a var can refer to vars previously bound in the let*.

The form

(let* ((var1 init-form-1)
(var2 init-form-2)
...
(varm init-form-m))
declaration1
declaration2
...
declarationp
form1
form2
...
formn)
first evaluates the expression init-form-1, then binds the variable var1 to that value;
then it evaluates init-form-2 and binds var2, and so on.
The expressions formj are then evaluated in order;
the values of all but the last are discarded (that is, the body of let* is an implicit progn).

For both let and let*, if there is not an init-form associated with a var, var is initialized to nil.

The special form let has the property that the scope of the name binding does not include any initial value form.
For let*, a variable's scope also includes the remaining initial value forms for subsequent variable bindings.


Examples:

(setq a 'top) => TOP
(defun dummy-function () a) => DUMMY-FUNCTION
(let ((a 'inside) (b a))
(format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE TOP TOP"
(let* ((a 'inside) (b a))
(format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE INSIDE TOP"
(let ((a 'inside) (b a))
(declare (special a))
(format nil "~S ~S ~S" a b (dummy-function))) => "INSIDE TOP INSIDE"

posted @ 2011-08-22 11:50 糯米 閱讀(827) | 評論 (1)編輯 收藏

lisp loop,dotimes,dolist,do

Simple LOOP loops forever...

? (loop
    (print "Look, I'm looping!"))
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
"Look, I'm looping!" 
... and so on, until you interrupt execution... 
Aborted
? 

? (let ((n 0))
    (loop
      (when (> n 10) (return))
      (print n) (prin1 (* n n))
      (incf n)))
0 0
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
NIL
?


Use DOTIMES for a counted loop

? (dotimes (n 11)
    (print n) (prin1 (* n n)))
0 0
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
NIL
?


Use DOLIST to process elements of a list

? (dolist (item '(1 2 4 5 9 17 25))
    (format t "~&~D is~:[n't~;~] a perfect square.~%" item (integerp (sqrt item))))
1 is a perfect square.
2 isn't a perfect square.
4 is a perfect square.
5 isn't a perfect square.
9 is a perfect square.
17 isn't a perfect square.
25 is a perfect square.
NIL


? (dolist (item `(1 foo "Hello" 79.3 2/3 ,#'abs))
    (format t "~&~S is a ~A~%" item (type-of item)))
1 is a FIXNUM
FOO is a SYMBOL
"Hello" is a (SIMPLE-BASE-STRING 5)
79.3 is a DOUBLE-FLOAT
2/3 is a RATIO
#<Compiled-function ABS #x1E9CC3E> is a FUNCTION
NIL
? 

DO is tricky, but powerful

? (do ((which 1 (1+ which))
       (list '(foo bar baz qux) (rest list)))
      ((null list) 'done)
    (format t "~&Item ~D is ~S.~%" which (first list)))
Item 1 is FOO.
Item 2 is BAR.
Item 3 is BAZ.
Item 4 is QUX.
DONE
? 
(do ((var1 init1 step1)
     (var2 init2 step2)
     ...)
    (end-test result)
  statement1
  ...)

var1       = which
init1      = 1
step1      = (1+ which)
var2       = list
init2      = '(foo bar baz qux)
step2      = (rest list)
end-test   = (null list)
result     = 'done
statement1 = (format t "~&Item ~D is ~S.~%" which (first list))



posted @ 2011-08-22 11:05 糯米 閱讀(546) | 評論 (0)編輯 收藏

lisp find find-if find-if-not

find item sequence &key from-end test test-not start end key => element

find-if predicate sequence &key from-end start end key => element

find-if-not predicate sequence &key from-end start end key => element

Arguments and Values:

item---an object.

sequence---a proper sequence.

predicate---a designator for a function of one argument that returns a generalized boolean.
接受一個(gè)參數(shù)的函數(shù),返回boolean

from-end---a generalized boolean. The default is false.
boolean類型,默認(rèn)為false

test---a designator for a function of two arguments that returns a generalized boolean.
接受兩個(gè)參數(shù)的函數(shù),返回boolean

test-not---a designator for a function of two arguments that returns a generalized boolean.
接受兩個(gè)參數(shù)的函數(shù),返回boolean

startend---bounding index designators of sequence. The defaults for start and end are 0 and nil, respectively.

key---a designator for a function of one argument, or nil.

element---an element of the sequence, or nil.

findfind-if, and find-if-not each search for an element of the sequence bounded by start and end that satisfies the predicate predicate or that satisfies the test test or test-not, as appropriate.

If from-end is true, then the result is the rightmost element that satisfies the test.

If the sequence contains an element that satisfies the test, then the leftmost or rightmost sequence element, depending on from-end, is returned; otherwise nil is returned.


Examples:

Examples:
(find #\d "here are some letters that can be looked at" :test #'char>)
=> #\Space
(find-if #'oddp '(1 2 3 4 5) :end 3 :from-end t) => 3
(find-if-not #'complexp '#(3.5 2 #C(1.0 0.0) #C(0.0 1.0)) :start 2) => NIL

posted @ 2011-08-19 22:04 糯米 閱讀(498) | 評論 (0)編輯 收藏

lisp MAPC, MAPCAR, MAPCAN, MAPL, MAPLIST, MAPCON

mapc function &rest lists+ => list-1

mapcar function &rest lists+ => result-list

mapcan function &rest lists+ => concatenated-results

mapl function &rest lists+ => list-1

maplist function &rest lists+ => result-list

mapcon function &rest lists+ => concatenated-results

mapcar operates on successive elements of the listsfunction is applied to the first element of each list, then to the second element of each list, and so on. The iteration terminates when the shortest list runs out, and excess elements in other lists are ignored. The value returned by mapcar is a list of the results of successive calls to function.

mapcar 首先將函數(shù)apply到每個(gè)列表的第一個(gè)元素,再將函數(shù)apply到每個(gè)列表的第二個(gè)元素。。
一直到最短的列表的最后一個(gè)元素。剩下的元素將被忽略。
它的結(jié)果是返回值不為nil的集合。

mapc is like mapcar except that the results of applying function are not accumulated. The list argument is returned.

mapc 和 mapcar 類似。不過返回的是第一個(gè)列表。

maplist is like mapcar except that function is applied to successive sublists of the listsfunction is first applied to the lists themselves, and then to the cdr of each list, and then to the cdr of the cdr of each list, and so on.

maplist 和 mapcar 類似,不過首先將函數(shù)apply到每個(gè)列表,然后將函數(shù)apply到每個(gè)列表的cdr,然后將函數(shù)apply到每個(gè)列表的cddr。。
直到最短的一個(gè)列表為空為止。

mapl is like maplist except that the results of applying function are not accumulated; list-1 is returned.

mapl和maplist類似,但是返回的是第一個(gè)列表。

mapcan and mapcon are like mapcar and maplist respectively, except that the results of applying function are combined into a list by the use of nconc rather than list. That is,

mapcan 和 mapcon 類似于 mapcar 和 maplist。它們使用 nconc 連接結(jié)果而不是 list。
Examples
(mapcar #'car '((1 a) (2 b) (3 c))) =>  (1 2 3)   
(mapcar #'abs '(3 -4 2 -5 -6)) => (3 4 2 5 6)
(mapcar #'cons '(a b c) '(1 2 3)) => ((A . 1) (B . 2) (C . 3))

(maplist #'append '(1 2 3 4) '(1 2) '(1 2 3))  =>  ((1 2 3 4 1 2 1 2 3) (2 3 4 2 2 3)) 
(maplist #'(lambda (x) (cons 'foo x)) '(a b c d)) => ((FOO A B C D) (FOO B C D) (FOO C D) (FOO D))
(maplist #'(lambda (x) (if (member (car x) (cdr x)) 0 1)) '(a b a c d b c)) => (0 0 1 0 1 1 1)
(setq dummy nil) =>  NIL   
(mapc #'(lambda (&rest x) (setq dummy (append dummy x)))
'(1 2 3 4)
'(a b c d e)
'(x y z)) => (1 2 3 4)
dummy => (1 A X 2 B Y 3 C Z)

(setq dummy nil) =>  NIL   
(mapl #'(lambda (x) (push x dummy)) '(1 2 3 4)) => (1 2 3 4)
dummy => ((4) (3 4) (2 3 4) (1 2 3 4))

(mapcan #'(lambda (x y) (if (null x) nil (list x y)))
'(nil nil nil d e)
'(1 2 3 4 5 6)) => (D 4 E 5)
(mapcan #'(lambda (x) (and (numberp x) (list x)))
'(a 1 b c 3 4 d 5)) => (1 3 4 5)

(mapcon #'list '(1 2 3 4)) =>  ((1 2 3 4) (2 3 4) (3 4) (4))  



 

posted @ 2011-08-19 21:44 糯米 閱讀(855) | 評論 (0)編輯 收藏

[轉(zhuǎn)]休息五分鐘,學(xué)幾個(gè)bash快捷鍵

From:


 

用快捷鍵,有兩個(gè)好處:

1 成就感!

2 效率!

停下手里活,學(xué)點(diǎn)一舉兩得的小技能,保證五分鐘搞定!

“棕色粗體”表示“我推薦的”!

Ctrl-A 相當(dāng)于HOME鍵,用于將光標(biāo)定位到本行最前面

Ctrl-E 相當(dāng)于End鍵,即將光標(biāo)移動到本行末尾

Ctrl-B 相當(dāng)于左箭頭鍵,用于將光標(biāo)向左移動一格

Ctrl-F 相當(dāng)于右箭頭鍵,用于將光標(biāo)向右移動一格

Ctrl-D 相當(dāng)于Del鍵,即刪除光標(biāo)所在處的字符

Ctrl-K 用于刪除從光標(biāo)處開始到結(jié)尾處的所有字符

Ctrl-L 清屏,相當(dāng)于clear命令

Ctrl-R 進(jìn)入歷史命令查找狀態(tài),然后你輸入幾個(gè)關(guān)鍵字符,就可以找到你使用過的命令

Ctrl-U 用于刪除從光標(biāo)開始到行首的所有字符。一般在密碼或命令輸入錯(cuò)誤時(shí)常用

Ctrl-H 刪除光標(biāo)左側(cè)的一個(gè)字符

Ctrl-W 用于刪除當(dāng)前光標(biāo)左側(cè)的一個(gè)單詞

Ctrl-P 相當(dāng)于上箭頭鍵,即顯示上一個(gè)命令

Ctrl-N 相當(dāng)于下箭頭鍵,即顯示下一個(gè)命令

Ctrl-T 用于顛倒光標(biāo)所在處字符和前一個(gè)字符的位置。(目前不知道有什么作用,哪位朋友知道?)

Ctrl-J 相當(dāng)于回車鍵

Alt-. 用于提取歷史命令中的最后一個(gè)單詞。你先執(zhí)行history命令,然后再敲擊此快捷鍵若干下,你就懂了!

Alt-BackSpace 用于刪除本行所有的內(nèi)容,基本上和Ctrl-U類似。

Alt-C 用于將當(dāng)前光標(biāo)處的字符變成大寫,同時(shí)本光標(biāo)所在單詞的后續(xù)字符都變成小寫。

Alt-L 用于將光標(biāo)所在單詞及所在單詞的后續(xù)字符都變成小寫。

Alt-U 用于將光標(biāo)所在單詞的光標(biāo)所在處及之后的所有字符變成大寫。

ps:使用bind -P命令可以查看所有鍵盤綁定。

ps2:Alt快捷鍵較少使用,因?yàn)槌3:途庉嬈鳑_突

over~

posted @ 2011-05-30 22:57 糯米 閱讀(17660) | 評論 (3)編輯 收藏

Trapping ctrl-c in Bash

#!/bin/bash

# trap ctrl
-c and call ctrl_c()
trap ctrl_c INT

function ctrl_c() {
        echo 
"** Trapped CTRL-C"
}

for i in `seq 1 5`; do
    sleep 
1
    echo 
-"."
done

posted @ 2011-05-30 22:53 糯米 閱讀(1179) | 評論 (0)編輯 收藏

POJ 3123 Ticket to Ride 高效解法

低效率解法在這里
低效率的解法是沒法通過POJ的數(shù)據(jù)的。
另外一個(gè)標(biāo)程中的解法十分給力,僅用時(shí)110ms(status上面還有用時(shí)16ms的)
首先來看一下這段程序:

#include <iostream>
#include 
<string>
#include 
<map>

using namespace std;

int main()
{
    
int INF=99999999,N,K,d[30][30],i,j,k,x,y,z,dp[256][30],e[8],v[30],c,b;
    
string s,t;    
    
while (cin >> N >> K && N) {
        map
<string,int> cityMap;
        
for(i=0;i<N;i++
            
for(j=0;j<N;j++
                d[i][j]
=i==j?0:INF;
        
for(i=0;i<N;i++) {
            cin 
>> s;
            cityMap[s]
=i;
        }
        
if (K)
            
while(cin >> s >> t >> z, x=cityMap[s], 
                    y
=cityMap[t], 
                    d[x][y]
=d[y][x]=min(d[y][x],z), --K);
        
for(k=0;k<N;k++)
            
for(i=0;i<N;i++)
                
for(j=0;j<N;j++)
                    d[i][j]
=min(d[i][j],d[i][k]+d[k][j]);
        
for(i=0;i<8;i++) {
            cin 
>> s;
            e[i]
=cityMap[s];
            
for(j=0;j<N;j++)
                dp[
1<<i][j]=d[j][e[i]];
        }        
        
for(i=1;i<256;i++) {
            
if (!(i&(i-1)))
                
continue;
            
// step1
            for(k=0;k<N;k++) {
                dp[i][k]
=INF;
                v[k]
=0;
                
for(j=1;j<i;j++)
                    
if ((i|j)==i)
                        dp[i][k]
=min(dp[i][k],dp[j][k]+dp[i-j][k]);
            }
            
// step2
            for(j=0;b=INF,j<N;j++) {
                
for(k=0;k<N;k++)
                    
if (dp[i][k]<=&& !v[k])
                        b
=dp[i][c=k];
                
for(k=0,v[c]=1;k<N;k++)
                    dp[i][c]
=min(dp[i][c],dp[i][k]+d[k][c]);
            }
        }
        
        
// step3
        for(i=0,b=INF;z=0,i<256;b=min(b,z),i++)
              
for(j=0;y=0,j<4;z+=!!y*dp[y][x],j++)
                
for(k=0;k<8;k+=2)
                      
if ((i>>k&3)==j)
                        y
+=3<<k,x=e[k];        
        
        cout 
<< b << endl;     
    }
    
return 0;
}

這段程序?qū)懙煤茏屓速M(fèi)解。花了半天時(shí)間我才搞明白。
實(shí)際上大體的思路是跟低效率的解法一樣的。
就是在求Minimal Steiner Tree這一步,它用了一種新的動態(tài)規(guī)劃的方法。
動態(tài)規(guī)劃的方程為:
dp[mask][i] = { 以點(diǎn)i為根,包含mask中的點(diǎn)的最小生成樹的權(quán)值 }

在得知 dp[mask - 1][1...N] 的情況下,如何推出 dp[mask][1...N] 呢?
程序中分為 step1 和 step2 兩個(gè)步驟。
step1 推出:
a = min{ dp[m1][i] + dp[m2][i] } 其中 m1|m2 = mask
這個(gè)很好理解。
step2 推出:
b = min{ dp[mask][j] + d[j][i] }
程序中每次都從 dp[mask][1...N] 中選出最小的一個(gè) dp[mask][c]
按這種順序更新就能保證結(jié)果的正確
因此 dp[mask][i] = min(a, b)

這個(gè)動態(tài)規(guī)劃法的確牛逼。

step3則是枚舉4條路線的各種組合情況。求出每種組合的MST權(quán)值。

代碼寫得很牛逼。看了半天才看懂。如果讓我寫,行數(shù)至少多出2,3倍來。。
老外就是牛逼,一行代碼都不浪費(fèi)。

posted @ 2011-02-24 17:16 糯米 閱讀(2068) | 評論 (1)編輯 收藏

POJ 3123 Ticket to Ride 動態(tài)規(guī)劃+Minimal Steiner Tree

這題絕對不是蓋的。
題目大意是:
給出一個(gè)無向圖,和四對數(shù)據(jù)。每對數(shù)據(jù)分別為圖中的兩個(gè)點(diǎn)。
要求添加一些邊,使每對點(diǎn)都能連通,讓總邊權(quán)最小。

首先考慮一個(gè)子問題:指定一些點(diǎn),添加一些邊,讓它們連通,并且總邊權(quán)最小。
這個(gè)問題就是Minimal Steiner Tree問題,解決方法可以見這里
這問題不是蓋的,它居然是NP完全問題。。
汗。。今天終于在POJ見識到啥叫NP完全問題了。。

大的問題可以分為多個(gè)子問題。可以枚舉所有pair的連接狀況。
比如說 {1和2鏈接,3和4鏈接} 或者 {1獨(dú)立,2獨(dú)立,3和4鏈接} 等等
一共有15種情況。分別為
    // 1,1,1,1
    {{1},{2},{3},{4}},
    // 1,1,2
    {{1,2},{3},{4}},
    {{1,3},{2},{4}},
    {{1,4},{2},{3}},
    {{2,3},{1},{4}},
    {{2,4},{1},{3}},
    {{3,4},{1},{2}},
    // 2,2
    {{1,2},{3,4}},
    {{1,3},{2,4}},
    {{1,4},{2,3}},
    // 1,3
    {{1,2,3},{4}},
    {{1,2,4},{3}},
    {{1,3,4},{2}},
    {{2,3,4},{1}},
    // 4
    {{1,2,3,4}},

其中有一些是重復(fù)的,就可以開一個(gè)數(shù)組保存下來。
貼一個(gè)我的程序。當(dāng)然,這個(gè)是TLE的。。官方的數(shù)據(jù)需要將近一分鐘才能跑完。
另外一個(gè)標(biāo)程運(yùn)行飛快,用得是更好的方法,點(diǎn)這里


#include <stdio.h>
#include 
<string.h>
#include 
<algorithm>
#include 
<cmath>

using namespace std;

char names[32][32];
int N, M;
int W[32][32];
const int INF = 10032*32;
int pairs[4];
int dp[256][2], dn;

int getcity(char *s)
{
    
int i;
    
for (i = 0; i < N; i++)
        
if (!strcmp(s, names[i]))
            
break;
    
return i;
}

int prim(int mask)
{
    
int i, j, mc, mi, a, c, t;

    c 
= 0;
    
for (i = 0; i < N; i++
        
if (mask & (1 << i)) {
            a 
= 1 << i;
            c
++;
        }

    t 
= 0;
    
while (--c) {
        mc 
= INF;
        
for (i = 0; i < N; i++)
            
if (a & (1 << i)) 
                
for (j = 0; j < N; j++)
                    
if (((mask ^ a) & (1 << j)) && W[i][j] < mc) {
                        mc 
= W[i][j];
                        mi 
= j;
                    }
        
if (mc == INF)
            
return INF;
        a 
|= 1 << mi;
        t 
+= mc;
    }

    
return t;
}

int K;

int dfs(int start, int mask, int n)
{
    
int i, r;

    
if (n >= K - 2)
        
return prim(mask);
    
    r 
= prim(mask);
    
for (i = start; i < N; i++
        
if ((1 << i) & ~mask) 
            r 
= min(r, dfs(i+1, mask|(1<<i), n+1));

    
return r;
}

int minicost(int mask)
{
    
int i, r;

    
for (i = 0; i < dn; i++)
        
if (mask == dp[i][0])
            
return dp[i][1];

    K 
= 0;
    
for (i = 0; i < N; i++)
        
if (mask & (1 << i))
            K
++;
    
    r 
= dfs(0, mask, 0);

    dp[dn][
0= mask;
    dp[dn][
1= r;
    dn
++;
    
return r;
}

int stats[15][8][8= {
    
// 1,1,1,1
    {{1},{2},{3},{4}},
    
// 1,1,2
    {{1,2},{3},{4}},
    {{
1,3},{2},{4}},
    {{
1,4},{2},{3}},
    {{
2,3},{1},{4}},
    {{
2,4},{1},{3}},
    {{
3,4},{1},{2}},
    
// 2,2
    {{1,2},{3,4}},
    {{
1,3},{2,4}},
    {{
1,4},{2,3}},
    
// 1,3
    {{1,2,3},{4}},
    {{
1,2,4},{3}},
    {{
1,3,4},{2}},
    {{
2,3,4},{1}},
    
// 4
    {{1,2,3,4}},
};

int main()
{
    
int i, j, k, a, b, c, ans;
    
char sa[32], sb[32];

    
while (scanf("%d%d"&N, &M), N) {
        
for (i = 0; i < N; i++)
            scanf(
"%s", names[i]);
        
for (i = 0; i < N; i++)
            
for (j = 0; j < N; j++)
                W[i][j] 
= INF;
        
for (i = 0; i < M; i++) {
            scanf(
"%s%s%d", sa, sb, &c);
            a 
= getcity(sa);
            b 
= getcity(sb);
            W[a][b] 
= W[b][a] = min(W[a][b], c);
        }
        
for (i = 0; i < 4; i++) {
            scanf(
"%s%s", sa, sb);
            a 
= getcity(sa);
            b 
= getcity(sb);
            pairs[i] 
= (1 << a) | (1 << b);
        }

        
// floyd
        for (k = 0; k < N; k++)
            
for (i = 0; i < N; i++)
                
for (j = 0; j < N; j++)
                    W[i][j] 
= min(W[i][k] + W[k][j], W[i][j]);

        dn 
= 0;
        ans 
= INF;
        
for (i = 0; i < 15; i++) {
            c 
= 0;
            
for (j = 0; stats[i][j][0]; j++) {
                a 
= 0;
                
for (k = 0; stats[i][j][k]; k++)
                    a 
|= pairs[stats[i][j][k] - 1];
                c 
+= minicost(a);
            }
            ans 
= min(ans, c);
        }

        printf(
"%d\n", ans);
    }
    
return 0;
}



 

posted @ 2011-02-24 00:44 糯米 閱讀(1109) | 評論 (0)編輯 收藏

Minimal Steiner Tree 簡介

MinimalSteinerTree 的意思是:
在圖中找出一個(gè)生成樹,需要將指定的數(shù)個(gè)點(diǎn)連接,邊權(quán)總值最小。
最小生成樹是 MinimalSteinerTree 的一種特殊情況。
此問題是NP完全問題。
在POJ 3123中的標(biāo)程給出了一個(gè)遞歸的算法來解決這個(gè)問題。

首先用floyd算法求出兩兩之間的最短路徑。
然后把所有點(diǎn)都兩兩鏈接起來,權(quán)值就是它們的最短路徑。
假設(shè)指定必須連接的點(diǎn)有N個(gè)。
那么MinimalSteinerTree 樹中的內(nèi)點(diǎn)最多有N-2個(gè)。
在紙上畫一下就知道了,內(nèi)點(diǎn)最多的情況就是樹為滿二叉樹的情況。
而由于之前的floyd算法。把整個(gè)圖給“縮”了一下。
所以樹最多有N-2+N個(gè)點(diǎn)。
枚舉所有可能的點(diǎn)集。對每個(gè)點(diǎn)集求最小生成樹。取最小值即可。

另外一種方法是使用動態(tài)規(guī)劃,詳情請見這里

posted @ 2011-02-24 00:19 糯米 閱讀(2437) | 評論 (1)編輯 收藏

僅列出標(biāo)題
共17頁: 1 2 3 4 5 6 7 8 9 Last 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一区二区三区在线播放| 国产自产在线视频一区| 亚洲日韩成人| 欧美激情视频在线免费观看 欧美视频免费一 | 欧美精品一区在线播放| 亚洲日本va在线观看| 欧美国产日韩一区二区| 欧美精品 国产精品| 国产精品99久久久久久久久| 亚洲无玛一区| 黄网站免费久久| 91久久精品国产91性色tv| 亚洲综合视频网| 亚洲免费视频中文字幕| 狠狠色丁香婷婷综合影院| 欧美二区在线看| 欧美色精品天天在线观看视频| 午夜一区在线| 另类亚洲自拍| 亚洲综合色在线| 免费日韩精品中文字幕视频在线| a4yy欧美一区二区三区| 香蕉成人伊视频在线观看 | 国产精品少妇自拍| 欧美sm视频| 国产精品一区在线播放| 亚洲第一搞黄网站| 国产毛片久久| 亚洲日韩欧美视频| 狠狠色狠狠色综合| 99re亚洲国产精品| 亚洲国产欧美一区| 性欧美xxxx视频在线观看| 亚洲精品资源美女情侣酒店| 久久不射中文字幕| 亚洲在线免费| 欧美日产国产成人免费图片| 久久资源av| 国产精品一区二区久久精品 | 久久久亚洲午夜电影| 欧美日韩国产一区精品一区| 久久午夜国产精品| 国产日本欧美视频| 一区二区三区四区国产| 99视频在线精品国自产拍免费观看| 欧美主播一区二区三区美女 久久精品人| 亚洲精品影院| 欧美成人免费大片| 欧美不卡视频一区| 狠狠色2019综合网| 欧美在线观看网址综合| 先锋影音久久久| 国产精品久久久久三级| 亚洲最新视频在线播放| 日韩午夜免费| 欧美黄免费看| 亚洲国产精品ⅴa在线观看 | 精东粉嫩av免费一区二区三区| 亚洲一区在线视频| 亚洲欧美自拍偷拍| 国产精品国产三级国产aⅴ入口| 亚洲伦理一区| 亚洲深夜av| 欧美体内she精视频| 最新高清无码专区| 亚洲理伦电影| 欧美日韩国产一区精品一区| 99精品国产高清一区二区| 在线亚洲观看| 欧美日韩一级片在线观看| 99xxxx成人网| 亚洲欧美精品中文字幕在线| 国产麻豆视频精品| 欧美在线日韩精品| 欧美二区视频| 久久久久一区| 欧美a级大片| 一区二区动漫| 国产精品免费观看视频| 性做久久久久久久久| 久久久人成影片一区二区三区观看 | 亚洲欧美另类中文字幕| 欧美自拍丝袜亚洲| **性色生活片久久毛片| 欧美刺激午夜性久久久久久久| 亚洲精品精选| 欧美一区二区免费| 亚洲高清不卡一区| 国产精品a久久久久久| 欧美永久精品| 91久久久久久久久久久久久| 亚洲一区国产一区| 国产婷婷成人久久av免费高清 | 亚洲视频免费在线| 久久久噜噜噜久噜久久| 99re在线精品| 国产一区视频在线观看免费| 欧美3dxxxxhd| 亚洲欧美日韩精品一区二区| 欧美福利一区| 午夜亚洲精品| 日韩亚洲综合在线| 国产亚洲毛片| 欧美日韩国产综合视频在线观看中文| 亚洲淫片在线视频| 亚洲国产高清视频| 久久国内精品视频| 一本一本久久| 伊人成人在线| 国产美女一区二区| 欧美日韩国产一区二区三区| 久久久.com| 亚洲免费在线视频| 亚洲精品色图| 欧美电影打屁股sp| 久久精品国产视频| 亚洲一二三级电影| 亚洲经典在线看| 国产一区二区在线观看免费| 欧美性jizz18性欧美| 欧美成人高清视频| 久久夜色精品一区| 欧美一级在线视频| 亚洲综合第一| 亚洲先锋成人| 99精品国产在热久久| 亚洲国产aⅴ天堂久久| 美脚丝袜一区二区三区在线观看| 欧美一级专区| 午夜精品在线| 亚洲欧美日韩精品久久奇米色影视| 亚洲国产裸拍裸体视频在线观看乱了| 国产午夜精品一区二区三区视频| 欧美视频中文字幕| 欧美三级欧美一级| 欧美精品综合| 欧美日韩裸体免费视频| 欧美劲爆第一页| 欧美日本国产在线| 欧美日韩国产不卡| 欧美四级伦理在线| 欧美视频你懂的| 国产精品久久久999| 国产精品高精视频免费| 国产精品高潮呻吟久久av无限| 国产精品爱啪在线线免费观看| 欧美午夜无遮挡| 国产酒店精品激情| 国产亚洲精品综合一区91| 黄色成人在线| 亚洲一区三区电影在线观看| 中国成人在线视频| 亚洲欧美国产三级| 久久成人免费电影| 久久综合给合久久狠狠色| 欧美二区不卡| 国产精品国产三级国产a| 国产日韩精品一区二区三区| 国语精品中文字幕| 亚洲国产天堂久久综合| 夜夜狂射影院欧美极品| 亚洲女性裸体视频| 久久综合九色综合久99| 欧美高清在线| 亚洲视频一起| 久久精品免费电影| 欧美极品aⅴ影院| 国产精品久久久久久久免费软件 | 亚洲精品视频在线播放| 亚洲一二三区视频在线观看| 久久精品视频免费| 亚洲国产一区二区在线| 亚洲专区一区二区三区| 另类专区欧美制服同性| 欧美色综合天天久久综合精品| 国内免费精品永久在线视频| 亚洲精品国产精品国自产观看 | 一区二区三区波多野结衣在线观看| 亚洲男人的天堂在线观看 | 亚洲一区二区三区免费在线观看| 久久国产精品一区二区| 亚洲国产专区校园欧美| 午夜伦欧美伦电影理论片| 久久男女视频| 国产精品高潮呻吟久久| 在线观看欧美| 亚洲欧美日韩精品一区二区| 亚洲国产精品成人综合| 欧美一区中文字幕| 欧美日韩中文精品| 亚洲高清色综合| 久久国产福利| 一本色道久久88综合日韩精品 | 久久久久久999| 国产精品国产福利国产秒拍| 亚洲精品综合久久中文字幕| 久久美女性网| 亚洲欧美日韩在线一区| 欧美日韩国产不卡| 99国内精品久久|