Interval DP
文章平均质量分 51
ZustinLau
I am currently studying Economics at the Chinese University of Hong Kong and I am interested in data structure and algorithms.
展开
-
312. Burst Balloons
Classical interval DP question. From observation, we know the left interval and right interval are independent to each other, only and only if the common balloons of two interval didnt brust. Here are some illustration: [1, 3, 4, 2, 1] left interval :原创 2022-03-24 04:53:16 · 85 阅读 · 0 评论 -
P4290 [HAOI2008]玩具取名
說實話,在這一題學到非常多的東西,尤其是對區間型動態規劃有了更全面的掌握。 整體的思路和普通的區間動態規劃差不多,左區間結果和右區間結果進行合併判斷。 狀態設計就是某區間能否轉化成某英文字母。 dp[i][j][k] = can interval [i : j] switch to k 那麼現在就要涉及轉移問題了? 首先,我們要有一個轉換表,表示為某兩個英文字可以轉為某個英文字,轉換表 switching_list[al1][al2][al3] = al2 and al3 is able to原创 2022-03-24 03:06:50 · 74 阅读 · 0 评论