原创 CodeForces 151B Phone Numbers(簡單模擬)

題目鏈接 B. Phone Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input outp

原创 poj 2923 Relocation(狀壓dp)

題目鏈接 Relocation Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2577   Accepted: 1052 Description Emm

原创 Topcoder SRM660 DIV1 250 Coversta(暴力枚舉)

題意:n*m的網格圖,每個網格有一個權值,範圍爲(0到9)。有一個x數組和y數組,這兩個數組大小相等且<=10。如果我們選擇一個點( i , j ) 。則可以覆蓋點 (i+x[k], j+y[k]),0<=k<=x數組的大小。問選擇兩個點

原创 Hdu 1059 Dividing(dp)

題目鏈接 Dividing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s):

原创 CodeForce 1153D(樹上動態規劃+貪心)

題目鏈接 題意:N個節點的樹,有K個葉子節點,需要將1,2,3...K,K個數任意填入K個葉子節點,每個葉子節點填一個數,每個數只能填入一個葉子節點。每個節點上有個一個運算,運算有兩種Max和Min。若運算爲Max,則該節點的值等於所有兒

原创 codeforces 601A The Two Routes(BFS)

題目鏈接 A. The Two Routes time limit per test 2 seconds memory limit per test 256 megabytes input standard input

原创 hiho1192 簡單的樹嵌入(構造題)

題目鏈接 #1192 : 簡單的樹嵌入 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 給定一棵n個點的無權樹。定義兩點i, j(0 ≤ i, j ≤ n - 1)間的距離d(i, j)爲

原创 codeforces 601C(概率dp)

題目鏈接 C. Kleofáš and the n-thlon time limit per test 1 second memory limit per test 256 megabytes input standard

原创 zoj 3882 Help Bob(博弈)

題目鏈接 Help Bob Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a game very popular in ZJU at present, Bob d

原创 codeforces 596E Wilbur and Strings(DFS)

題目鏈接 E. Wilbur and Strings time limit per test 3 seconds memory limit per test 256 megabytes input standard inp

原创 codeforces 601B Lipshitz Sequence

題目鏈接 B. Lipshitz Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input

原创 java 匿名內部類

轉自:http://www.cnblogs.com/nerxious/archive/2013/01/25/2876489.html 匿名內部類也就是沒有名字的內部類 正因爲沒有名字,所以匿名內部類只能使用一次,它通常用來簡化代

原创 java 參數傳遞

轉載自:http://blog.sina.com.cn/s/blog_4b622a8e0100c1bo.html Java中的參數傳遞機制一直以來大家都爭論不休,究竟是“傳值”還是“傳址(傳引用)”,爭論的雙方各執一詞,互不相讓。不

原创 poj 1160 Post Office(四邊形不等式優化dp)

轉載自:http://www.cnblogs.com/staginner/archive/2012/03/12/2391925.html           POJ_1160     我們可以用f[i][j]表示建好i個郵局時覆蓋到第j

原创 poj 1734 Sightseeing trip(floyd求最小環並輸出方案)

題目鏈接 Sightseeing trip Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5736   Accepted: 2220   Special Ju