摘要:
有n首歌,每首时长Ti,要把这n首歌装进m个光盘里面,每个光盘最多能存的时长为t. 要求这些歌在光盘里面要按照所给歌的先后顺序存入,不能改变前后顺序. 例如有4首歌,按顺序给出他们的时长:1,2,3,4. 装入一个容量时长为10的光盘里,可以是1,2,3或者1,3,4等,但是不能2,1,3. 问最多 阅读全文
posted @ 2022-10-30 13:49
towboat
阅读(16)
评论(0)
推荐(0)
摘要:
矩阵连乘 用 栈 处理表达式 ((AB)C) #include <iostream> #include <cstdio> #include <string> #include <stack> using namespace std ; struct M{ int a,b; M(int a0=0,in 阅读全文
posted @ 2022-10-30 12:52
towboat
阅读(26)
评论(0)
推荐(0)
摘要:
将字符串变为回文串最少需要几次操作(在任意位置插入字符),并输出变化后的回文串f[l][r] = f[l+1][r-1] // a[i]==a[j] =min(f[l+1][r],f[l][r-1]) #include <iostream> #include <cstring> using name 阅读全文
posted @ 2022-10-30 12:43
towboat
阅读(21)
评论(0)
推荐(0)
摘要:
n个仓库,安排m个人看守,每个仓库只由一个人看守,每个人对应a[i] ,表示能量(薪水) 如果某个人看守k个仓库,每个仓库能量值 a[i]/k 求仓库能量最小值最大时,所支付薪水最少值 #include <iostream> #include <algorithm> #include <cstrin 阅读全文
posted @ 2022-10-30 00:10
towboat
阅读(30)
评论(0)
推荐(0)
浙公网安备 33010602011771号