- 博客(8)
- 收藏
- 关注
原创 UESTC 1137 邱老师选妹子 dp:?这个难道不是暴力法
邱老师长得帅这是人尽皆知,于是追他的妹子就会很多。 但是你知道,邱老师是一个很专一的人,所以他心里面只能有一个人。 于是他决定从追他的众多妹子里挑选一个出来。于是酱神给邱老师出来一个主意,已知有一些妹子,恰好可以给她们从l到r排号,使得每一个妹子有单独的数字,而正好有r-l+1个妹子。 酱神说,我们不能要运气不好的女孩,而酱神又给了两个数字62和4,如果妹子的排号里面有62(必须是连续的)或4,那么就排除他现在给你l和r,问有多少妹子可以有幸在第一轮留下。
2016-02-28 18:28:04 1265
原创 UESTC 1131 男神的礼物 dp:最优矩阵链乘&&triangulation&&双dp
Lweb学长是集训队里公认的男神。有一天他要给美美的学姐姐准备礼物。 Lweb学长可是会魔法的哟。为了准备一份礼物,男神要加工n份材料。每一次只能加工相邻的材料。 当男神加工两个魔法值为a,b的材料,男神都要消耗a*b的体力,同时在这个地方合成出魔法值(a+b)%100的材料。 男神为了能节省体力来完成他的礼物。想找聪明的你帮他算一算他所要花费的最小体力。
2016-02-28 16:55:13 1220
原创 UVa 10003 Cutting Sticks dp : 线性dp triangulation三角剖分
You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut. Their procedure of work requires that they only make one cut at a time. It is eas
2016-02-28 11:29:16 807
原创 UVA 1626 Brackets sequence dp:经典&&类似于三角剖分
Let us define a regular brackets sequence in the following way: Empty sequence is a regular sequence. If S is a regular sequence, then (S) and [S] are both regular sequences. If A and B are regular sequences, then AB is a regular sequence. For example, all
2016-02-27 22:34:26 994
原创 UVa 11584 Partitioning by Palindromes dp : 线性结构上dp LIS
A partition of a sequence of characters is a list of one or more disjoint non-empty groups of consecutive characters whose concatenation yields the initial sequence. For example, (‘race’, ‘car’) is a partition of ‘racecar’ into two groups. Given a sequence
2016-02-26 19:16:53 839
原创 UVa 11400 Lighting System Design dp : 线性结构上dp LIS
You are given the task to design a lighting system for a huge conference hall. After doing a lot of calculation and sketching, you have figured out the requirements for an energy-efficient design that can properly illuminate the entire hall. According to y
2016-02-25 20:25:23 1127
原创 UVa 12563 Jin Ge Jin Qu hao dp : 0-1背包问题
(If you smiled when you see the title, this problem is for you ^_^) For those who don’t know KTV, see: http://en.wikipedia.org/wiki/Karaoke_box There is one very popular song called Jin Ge Jin Qu(). It is a mix of 37 songs, and is extremely long (1
2016-02-24 17:29:19 1744
原创 UVa 1025 A Spy in the Metro dp : DAG、最短路
Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro, examining the timetable. The Algorithms City Metro consists of a single l
2016-02-16 18:09:34 1133
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人