原创 G - Vitya and Strange Lesson(數組-字典樹)

G - Vitya and Strange Lesson  CodeForces - 842D  Today at the lesson Vitya learned a very interesting function — mex. M

原创 Euclid's Game

B - Euclid's Game Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtrac

原创 C UVA 12293 Box Game

  There are two identical boxes. One of them contains n balls, while the other box contains one ball. Alice and Bob inv

原创 B-Dining(EK算法)

B - Dining   Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume

原创 Glad You Came (線段樹)

Glad You Came Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s

原创 Minimum Cost ——多源點最小費用最大流

E - Minimum Cost   Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area the

原创 G - Oil Skimming ——二分圖匹配(匈牙利算法)

G - Oil Skimming Thanks to a certain "green" resources company, there is a new profitable industry of oil skimming. The

原创 I - Strategic Game (二分圖最大匹配的性質)

I - Strategic Game Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solu

原创 F - Power Network (Dinic 鄰接表+queue)

F - Power Network A power network consists of nodes (power stations, consumers and dispatchers) connected by power tran

原创 H - Antenna Placement (最小路徑覆蓋)

H - Antenna Placement   The Global Aerial Research Centre has been allotted the task of building the fifth generation o

原创 K - Treasure Exploration (最大路徑覆蓋)

K - Treasure Exploration Have you ever read any book about treasure exploration? Have you ever see any film about treas

原创 F - Rain on your Parade (HK)

F - Rain on your Parade You’re giving a party in the garden of your villa by the sea. The party is a huge success, and

原创 B - 物流運輸

B - 物流運輸  物流公司要把一批貨物從碼頭A運到碼頭B。由於貨物量比較大,需要n天才能運完。貨物運輸過程中一般要轉 停好幾個碼頭。物流公司通常會設計一條固定的運輸路線,以便對整個運輸過程實施嚴格的管理和跟蹤。由於各種 因素的存在,有的

原创 A - Fire Net (二分圖匹配)

A - Fire Net Suppose that we have a square city with straight streets. A map of a city is a square board with n rows an

原创 D - 棋盤遊戲 (二分匹配)

D - 棋盤遊戲 小希和Gardon在玩一個遊戲:對一個N*M的棋盤,在格子裏放盡量多的一些國際象棋裏面的“車”,並且使得他們不能互相攻擊,這當然很簡單,但是Gardon限制了只有某些格子纔可以放,小希還是很輕鬆的解決了這個問題(見下圖)