原创 Highways --(Kruskal和prim)C - Highways POJ - 1751

Highways  POJ - 1751  The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor syst

原创 Five-In-a-Row CodeForces - 825B

Five-In-a-Row  CodeForces - 82 Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turn

原创 Meteor Shower POJ - 3669

 Meteor Sh ower  POJ - 3669  Bessie hears that an extraordinary meteor shower is coming; reports say that these me

原创 昂貴的聘禮 POJ - 1062 (Dijkstra)

昂貴的聘禮  POJ - 1062 年輕的探險家來到了一個印第安部落裏。在那裏他和酋長的女兒相愛了,於是便向酋長去求親。酋長要他用10000個金幣作爲聘禮才答應把女兒嫁給他。探險家拿不出這麼多金幣,便請求酋長降低要求。酋長說:"嗯,如

原创 Find The Multiple ——深搜POJ - 1426

Find The Multiple  POJ - 1426  Given a positive integer n, write a program to find out a nonzero multiple m of n

原创 N皇后問題 HDU - 2553

N皇后問題  HDU - 2553  在N*N的方格棋盤放置了N個皇后,使得它們不相互攻擊(即任意2個皇后不允許處在同一排,同一列,也不允許處在與棋盤邊框成45角的斜線上。  你的任務是,對於給定的N,求出有多少種合法的放置方法。 

原创 find the most comfortable road HDU - 1598 (並查集)

find the most comfortable road  HDU - 1598   XX星有許多城市,城市之間通過一種奇怪的高速公路SARS(Super Air Roam Structure---超級空中漫遊結構)進行交流,

原创 Sudoku POJ - 2676(數獨)

 Sudoku  POJ - 2676 Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller

原创 疊框

      需要的時候,就把一個個大小差一圈的筐疊上去,使得從上往下看時,邊筐花色交錯。這個工作現在要讓計算機來完成,得看你的了。 Input輸入是一個個的三元組,分別是,外筐尺寸n(n爲滿足0<n<80的奇整數),中心花色字符,外筐花

原创 Genealogical tree POJ - 2367(拓撲模板)

 Genealogic al tree  POJ - 2367 The system of Martians' blood relations is confusing enough. Actually, Martians

原创 1160 蛇形矩陣

1160 蛇形矩陣 題目描述 Description 小明玩一個數字遊戲,取個n行n列數字矩陣(其中n爲不超過100的奇數),數字的填補方法爲:在矩陣中心從1開始以逆時針方向繞行,逐圈擴大,直到n行n列填滿數字,請輸出該n行n列正

原创 Binary Tree Traversals HDU - 1710 (二叉樹求後序)

Binary Tree Traversals  HDU - 1710  A binary tree is a finite set of vertices that is either empty or consists of a r

原创 Wooden Sticks HDU - 1051 (貪心)

 Wooden Sticks  HDU -1051  There is a pile of n wooden sticks. The length and weight of each stick are known in adv

原创 C語言:小希的迷宮 HDU - 1272 (並查集——檢驗是否有迴路)

小希的迷宮HDU - 1272 上次Gardon的迷宮城堡小希玩了很久(見Problem B),現在她也想設計一個迷宮讓Gardon來走。但是她設計迷宮的思路不一樣,首先她認爲所有的通道都應該是雙向連通的,就是說如果有一個通道連