首页 > TAG信息列表 > Lorry

1.24 Lorry

https://acs.jxnu.edu.cn/problem/CF3Bhttps://acs.jxnu.edu.cn/problem/CF3B A group of tourists is going to kayak and catamaran tour. A rented lorry has arrived to the boat depot to take kayaks and catamarans to the point of departure. It's known that a

【学习笔记】CF3B Lorry 题解

题目传送门 正解 思路 因为物品的重量只有 1 和 2,所以考虑暴力枚举选择多少个 2 ,剩下的尽可能多地填充 1 即可。 为什么“尽可能多”正确呢?很显然,这是因为物品的价值 \(\ge 1\) 。 至于怎么选择,只需要将物品的价值从大到小排序,然后取靠前的即可。 注意使用前缀和优化。

codeforces lorry

刚开始一看这不01背包 一看数据nm炸了 特点是v只可能是1或者2 而2=1+1 建两个大根堆,每次拎q1的两个头出来和q2的一个头出来比较 一个很小的优化就是如果v为奇数,那么q1的最大肯定要先取 ——----- 最近状态很烂,补一个死活卡在21不知道re在哪里的代码 #include<bits/stdc++.h> usin