随笔分类 -  动态规划—区间DP

摘要:题目描述 Bessie likes downloading games to play on her cell phone, even though she doesfind the small touch screen rather cumbersome to use with her large 阅读全文
posted @ 2021-10-20 11:25 脂环 阅读(30) 评论(0) 推荐(0) 编辑
摘要:问题描述 X 校最近打算美化一下校园环境。前段时间因为修地铁,X 校大门外种的行道树全部都被移走了。现在 X 校打算重新再种一些树,为校园增添一抹绿意。 X 校大门外的道路是东西走向的,我们可以将其看成一条数轴。在这条数轴上有 n 个障碍物,例如电线杆之类的。虽然障碍物会影响树的生长,但是障碍物不一 阅读全文
posted @ 2021-07-16 14:43 脂环 阅读(3750) 评论(4) 推荐(4) 编辑
摘要:You are given two integer arrays a and b of length n. You can reverse at most one subarray (continuous subsegment) of the array 𝑎a. Your task is to r 阅读全文
posted @ 2021-04-30 10:52 脂环 阅读(68) 评论(0) 推荐(0) 编辑
摘要:题目描述 在MarsMar**s星球上,每个MarsMar**s人都随身佩带着一串能量项链。在项链上有NN颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标记。因为只有这样,通过吸盘(吸盘是MarsMar**s 阅读全文
posted @ 2021-04-14 16:04 脂环 阅读(166) 评论(0) 推荐(0) 编辑
摘要:C. Kaavi and Magic Spell https://blog.csdn.net/qq_43676357/article/details/105559491?fps=1&locationNum=2 有时间仔细研究一下 阅读全文
posted @ 2020-04-16 22:59 脂环 阅读(232) 评论(0) 推荐(0) 编辑
摘要:There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help 阅读全文
posted @ 2020-03-20 01:06 脂环 阅读(129) 评论(0) 推荐(0) 编辑
摘要:The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the r 阅读全文
posted @ 2020-03-19 00:46 脂环 阅读(193) 评论(0) 推荐(0) 编辑
摘要:Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it. You are given string s 阅读全文
posted @ 2020-03-18 20:44 脂环 阅读(283) 评论(0) 推荐(0) 编辑
摘要:We give the following inductive definition of a “regular brackets” sequence: the empty sequence is a regular brackets sequence, if s is a regular brac 阅读全文
posted @ 2020-03-18 12:20 脂环 阅读(228) 评论(0) 推荐(0) 编辑
摘要:Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Hal 阅读全文
posted @ 2020-03-18 01:01 脂环 阅读(193) 评论(0) 推荐(0) 编辑
摘要:题目描述 在一个圆形操场的四周摆放 NNN 堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。 试设计出一个算法,计算出将 NNN 堆石子合并成 111 堆的最小得分和最大得分。 输入格式 数据的第 111 行是正整数 NNN,表 阅读全文
posted @ 2020-03-17 11:15 脂环 阅读(200) 评论(0) 推荐(0) 编辑
摘要:Description 在科学计算中经常要计算矩阵的乘积。矩阵A和B可乘的条件是矩阵A的列数等于矩阵B的行数。若A是一个p×q的矩阵,B是一个q×r的矩阵,则其乘积C=AB是一个p×r的矩阵。 由公式知计算C=AB总共需要pqr次的数乘。 为了说明在计算矩阵连乘积时加括号方式对整个计算量的影响,我们 阅读全文
posted @ 2020-03-16 21:26 脂环 阅读(464) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩