原创 Luogu 1140 相似基因

Luogu 1140 相似基因 (線性動態規劃) 線性dp 題目背景 大家都知道,基因可以看作一個鹼基對序列。它包含了44種核苷酸,簡記作A,C,G,TA,C,G,T。生物學家正致力於尋找人類基因的功能,以利用於診斷疾病和發明藥物

原创 SDUWH 新星賽線上模擬賽

7-1 factorial 題目描述 In many applications very large integers numbers are required. Some of these applications are us

原创 POJ 3616 Milking Time 線性dp

Milking Time (基礎dp) 題目描述 Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivi

原创 CF761C Dasha and Password(線性dp)

洛谷鏈接 https://www.luogu.com.cn/problem/CF761C 題目大意 給n個字符串,每個長m,初始光標都在每個字符串的開頭位置,通過移動光標,從n個字符串中各選擇一個字符,構成密碼,(移動光標時把長度

原创 CF835C Star sky (二維前綴和)

CF835C Star sky 洛谷鏈接 題目描述 The Cartesian coordinate system is set in the sky. There you can see n stars, the i -th h

原创 P1879 [USACO06NOV]Corn Fields G (狀壓dp)

P1879 [USACO06NOV]Corn Fields G 洛谷鏈接 題目描述 Farmer John has purchased a lush new rectangular pasture composed of M by

原创 洛谷P2015 二叉蘋果樹 (樹形dp)

鏈接: 洛谷2015 二叉蘋果樹 題目描述 有一棵蘋果樹,如果樹枝有分叉,一定是分2叉(就是說沒有隻有1個兒子的結點) 這棵樹共有N個結點(葉子點或者樹枝分叉點),編號爲1-N,樹根編號一定是1。 我們用一根樹枝兩端連接的結點的編

原创 hdoj 1892 See you~(二維樹狀數組)

hdoj 1892 See you~ 鏈接 Problem Description Now I am leaving hust acm. In the past two and half years, I learned so m

原创 Codeforces Round #627 (Div. 3) E - Sleeping Schedule (線性dp)

**E Sleeping Schedule ** 題目描述 Vova had a pretty weird sleeping schedule. There are h hours in a day. Vova will sle

原创 hdoj 6514 Monitor (二維差分 + 二維前綴和)

hdoj 6514 Monitor Problem Description Xiaoteng has a large area of land for growing crops, and the land can be seen

原创 洛谷 P1896 [SCOI2005]互不侵犯 (狀壓dp)

洛谷 P1896 [SCOI2005]互不侵犯 洛谷鏈接 題目描述 在N×N的棋盤裏面放K個國王,使他們互不攻擊,共有多少種擺放方案。國王能攻擊到它上下左右,以及左上左下右上右下八個方向上附近的各一個格子,共8個格子。 輸入格式

原创 洛谷 P2704 [NOI2001]炮兵陣地 (狀壓dp)

P2704 [NOI2001]炮兵陣地 洛谷鏈接 題目描述 司令部的將軍們打算在NM的網格地圖上部署他們的炮兵部隊。一個NM的地圖由N行M列組成,地圖的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下圖。在每

原创 CF859C Pie Rules(dp)

CF859C Pie Rules luogu鏈接 題目描述 You may have heard of the pie rule before. It states that if two people wish to fairl

原创 ICPC NEAU Programming Contest 2020

B.數字分佈 (構造) 題目描述 https://nanti.jisuanke.com/t/45507 構造一個含有n個正整數的序列,並滿足以下要求: 1.序列是不遞減的,a1 <= a2 <= … <= an 2.序列中滿足 j

原创 近期做的dp題整理

一. 張老師的旅行 鏈接 題目描述 張老師到了一個王國去旅遊,王國有n個景點,張老師到達這個城市所在的車站恰好位於第x個景點,這個王國非常特別,恰好所有著名的景點都在分佈在直線上,每個景點在座標pi上(單位:公里),張老師身體非常