原创 孩子們的遊戲(圓圈中最後剩下的數) 約瑟夫環
題目描述 每年六一兒童節,牛客都會準備一些小禮物去看望孤兒院的小朋友,今年亦是如此。HF作爲牛客的資深元老,自然也準備了一些小遊戲。其中,有個遊戲是這樣的:首先,讓小朋友們圍成一個大圈。然後,他隨機指定一個數m,讓編號爲0的小朋友開始報數
原创 POJ - 1113 Wall (凸包 Graham掃描算法 | 捲包裹算法)
Wall Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castl
原创 HDU - 5988 Coding Contest (最小費用最大流)
Coding Contest A coding contest will be held in this university, in a huge playground. The whole playground would be
原创 HihoCoder - 1634 Puzzle Game (最大子矩陣和)
Puzzle Game Once upon a time, there was a little dog YK. One day, he went to an antique shop and was impressed by a b
原创 POJ - 2391 Ombrophobic Bovines (Floyd + 二分 +ISAP)
Ombrophobic Bovines FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes
原创 LightOJ - 1027 A Dangerous Maze (期望)
A Dangerous Maze You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. Th
原创 LightOJ - 1079 Just another Robbery (概率 +揹包)
Just another Robbery As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants
原创 用兩個棧實現隊列 C++
題目描述 用兩個棧來實現一個隊列,完成隊列的Push和Pop操作。 隊列中的元素爲int類型。 題目鏈接:https://www.nowcoder.com/practice/54275ddae22f475981afa2244dd448
原创 LightOJ - 1030 Discovering Gold (期望DP)
Discovering Gold You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave c
原创 LightOJ - 1104 Birthday Paradox (期望DP)
Birthday Paradox Sometimes some mathematical results are hard to believe. One of the common problems is the birthday
原创 POJ - 2114 Boatherds (點分治 距離等於k的點對)
Boatherds Boatherds Inc. is a sailing company operating in the country of Trabantustan and offering boat trips on Tra
原创 LightOJ - 1038 Race to 1 Again (期望DP)
Race to 1 Again Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divide
原创 POJ - 1987 Distance Statistics (點分治 距離小於等於k的點對)
Distance Statistics Frustrated at the number of distance queries required to find a reasonable route for his cow mara
原创 HDU - 4812 D Tree (點分治 + 逆元預處理 )
D Tree There is a skyscraping tree standing on the playground of Nanjing University of Science and Technology. On eac
原创 POJ - 1741 Tree (點分治 求路徑距離小於等於k的點對)
Tree Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min di