
acm
文章平均质量分 67
lemon
这个作者很懒,什么都没留下…
展开
-
第五届新疆省ACM-ICPC程序设计竞赛 H. 虚无的后缀(动态规划+滚动数组优化)
题目:链接:https://ac.nowcoder.com/acm/problem/26157给出 n 个数字,第 i 个数字为 a[i],我们从中选出 k 个数字,使得乘积后缀 0 的个数最多。思路 :先把每个数拆分成有多少2和5然后考虑对这些数跑01背包,每个数里5的个数是花费,2的个数是重量接下来考虑方程的转移动态规划 dp[i][j][s]表示前i个数里面拿j个,一共有s个5的时候最多有多少个2然后考虑dp的转移当前到第i个数先考虑不拿这个数那么就有dp[i][j][s]=dp原创 2021-05-10 13:16:08 · 195 阅读 · 0 评论 -
2021年度训练联盟热身训练赛第三场 KSummer Trip
Summer Trip题目描述Leo has started a job in a travel agency. His first task is to organize a summer trip to an exotic overseas city. During the summer season, events of various types take place in the city: sports matches, concerts, beach parties, and many o原创 2021-03-21 21:40:55 · 249 阅读 · 1 评论 -
2021年度训练联盟热身训练赛第二场 The Eternal Quest for Caffeine
The Eternal Quest for CaffeineLike most engineering students, Jason relies on caffeine, soda in particular, to get him through long nights in the lab. He’s not too picky about the brand; as long as it’s fizzy, loaded with caffeine, and not the “diet” vers原创 2021-03-16 00:15:58 · 268 阅读 · 0 评论 -
2020年团体程序设计天梯赛-总决赛 L2-3 完全二叉树的层序遍历 (25分)
L2-3 完全二叉树的层序遍历 (25分)一个二叉树,如果每一个层的结点数都达到最大值,则这个二叉树就是完美二叉树。对于深度为 D 的,有 N 个结点的二叉树,若其结点对应于相同深度完美二叉树的层序遍历的前 N 个结点,这样的树就是完全二叉树。给定一棵完全二叉树的后序遍历,请你给出这棵树的层序遍历结果。输入格式:输入在第一行中给出正整数 N(≤30),即树中结点个数。第二行给出后序遍历序列,为 N 个不超过 100 的正整数。同一行中所有数字都以空格分隔。输出格式:在一行中输出该树的层序遍历序列原创 2020-12-01 17:21:53 · 2327 阅读 · 5 评论 -
矩形嵌套 (DAG模型动态规划)
题目地址https://vjudge.net/problem/%E8%AE%A1%E8%92%9C%E5%AE%A2-T1408https://nanti.jisuanke.com/t/T1408描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于旋转X90度)。例如(1,5)可以嵌套在(6,2)内,但不能嵌套在(3,4)中。你的任务是选出尽可能多的矩形排成一行,使得除最后一个外,每原创 2020-08-11 16:57:59 · 1220 阅读 · 0 评论 -
UCF “Practice” Local Contest — Aug 31, 2019 Anya’s Favorite CD
A few years ago, Arup started submitting problems to the UCF Local Contest regarding her daughter Anya’s CD requests. Unfortunately, his latest question wasn’t good enough to make the cut for the 2019 UCF Local Contest. Luckily, a couple coaches, nostalgic原创 2020-07-24 22:15:14 · 387 阅读 · 0 评论