dp
文章平均质量分 85
佑月、
这个作者很懒,什么都没留下…
展开
-
hdu5956 The Elder (树型dp, 斜率优化)
传送门:The Elder - HDU 5956 - Virtual Judge Once upon a time, in the mystical continent, there is a frog kingdom, ruled by the oldest frog, the Elder. The kingdom consists of N cities, numbered from east to west. The 1-th city, which is located to the east .原创 2022-05-18 22:59:17 · 141 阅读 · 0 评论 -
G.Cyclic Buffer(数据结构优化 dp 澳门站2022)
链接:登录—专业IT笔试面试备考平台_牛客网来源:牛客网 有一个大小为 nnn 的循环缓冲区,读取器从第 111 个位置到第 kkk 个位置(包括两者)。令 aia_iai (1≤i≤n1 \le i \le n1≤i≤n) 为缓冲区最初第 iii 个位置的整数。此外,a1,a2,⋯,ana_1, a_2, \cdots, a_na1,a2,⋯,an 形成了 nnn 的一个排列。 我们将按升序访问从 111 到 nnn(包括两者)的所有整数。一个整数只有在它位于读者的位置时才能被访问(也就..原创 2022-04-24 17:43:31 · 718 阅读 · 0 评论 -
D. Infinite Set(线性dp)
Problem - D - Codeforces D. Infinite Set time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an arrayaaconsisting ofnndistinctpositive integers. Let's consider an infi...原创 2022-02-21 17:39:42 · 762 阅读 · 0 评论 -
小 A 的卡牌游戏(dp, 贪心)
传送门:小 A 的卡牌游戏 - Gym 103186B - Virtual Judge 小 A 最近沉迷于一款名为 Hearthverse 的卡牌游戏。在这款游戏中,卡被分为了三个种类(随从、法术和魔法阵),在组卡时,这款游戏严格规定了卡组中每种卡牌的数量,具体来说,一副nn张卡的卡组需要包含恰好aa张随从卡,bb张法术卡和cc张魔法阵卡,并且a + b + c = na+b+c=n。 在游戏中,有一个叫做 "3pick" 的组卡竞技方式,游戏会给出nn次三选一的机会,三张卡分...原创 2021-11-26 17:03:35 · 3127 阅读 · 0 评论 -
Play Game (HDU 4597)(dp, 记忆化搜索)
题目: Play Game - HDU 4597 - Virtual Judge Alice and Bob are playing a game. There are two piles of cards. There are N cards in each pile, and each card has a score. They take turns to pick up the top or bottom card from either pile, and the score of the.原创 2021-10-19 09:31:19 · 134 阅读 · 0 评论 -
cf1455 D. Sequence and Swaps(dp, 思维)
题目: Problem - 1455D - Codeforces time limit per test 1.5 seconds memory limit per test 512 megabytes input standard input output standard output You are given a sequenceaaconsisting ofnnintegersa1,a2,…,ana1,a2,…,an, and an integerxx. Your t...原创 2021-10-14 16:25:56 · 115 阅读 · 0 评论