原创 ZOJ 3195 Design the city(LCA 樹上三點最短距離)

Design the city Time Limit: 1000 msMemory Limit: 32768 KB Cerror is the mayor of city HangZhou. As you may know, the tr

原创 hdu2586 How far away ?(tarjin求LCA)

How far away ? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s):

原创 [HAOI2016]食物鏈(拓撲排序 + dp)

鏈接:https://ac.nowcoder.com/acm/problem/20000 來源:牛客網   時間限制:C/C++ 1秒,其他語言2秒 空間限制:C/C++ 262144K,其他語言524288K 64bit IO Form

原创 NK996D 最短Hamilton路徑(狀壓dp)

鏈接:https://ac.nowcoder.com/acm/contest/996/D 來源:牛客網   題目描述 給定一張 n(n≤20)(n \leq 20)(n≤20) 個點的帶權無向圖,點從0∼n−10 \sim n-10∼n−

原创 sdnu1592 easy problem(線性基)

Description Albert_s has a multiset S, this question requires you to find a subset T of S that maximizes the express

原创 UCF Local Programming Contest 2016 H. Count the Dividing Pairs(整除對數)

Number Theory provides many fascinating properties. You have most likely written programs dealing with different groups

原创 ICPC Asia Taipei-Hsinchu Regional 2019 H.Mining a(思維)

Problem Description Blockchain technology is used in many digital currency systems, such as Bitcoin and Ethereum. In th

原创 HRBUST - 1819 石子合併問題--圓形版 (區間dp)

在圓形操場上擺放着一行共n堆的石子。現要將石子有序地合併成一堆。規定每次只能選相鄰的兩堆合併成新的一堆,並將新的一堆石子數記爲該次合併的得分。請編輯計算出將n堆石子合併成一堆的最小得分和將n堆石子合併成一堆的最大得分。 Input 輸入有

原创 codeforces1328 D - Carousel(思維)

D. Carousel time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp

原创 POJ - 1661 Help Jimmy (dp)

"Help Jimmy" 是在下圖所示的場景上完成的遊戲。   場景中包括多個長度和高度各不相同的平臺。地面是最低的平臺,高度爲零,長度無限。 Jimmy老鼠在時刻0從高於所有平臺的某處開始下落,它的下落速度始終爲1米/秒。當Jimmy

原创 HDU - 2859 Phalanx (dp_最大對稱子圖)

Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC.

原创 ICPC Latin American Regional Contests 2019 K. Know your Aliens(頂點式轉一般式)

Our world has been invaded by shape shifting aliens that kidnap people and steal their identities.You are an inspector

原创 Arab Collegiate Programming Contest 2015 I. Problem I. Journey(dp)

One day, Homer was bored in his house and decided to go in a journey to discover the lands of Springfield.The lands of

原创 ICPC Asia Taipei-Hsinchu Regional 2019 The League of Sequence Designers(構造)

Problem Description Consider the following sequence problem: given nn integers a_{1}, a_{2}, \ldots, a_{n},a1​,a2​,…,an

原创 POJ - 2777 Count Color(線段樹 + 狀態壓縮)

Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here,