点击打开链接http://codeforces.com/contest/3/problem/BB. LorryDescriptionA group of tourists is going to kayak and catamaran tour. A rented lorry has arrived to the boat depot t
原创
2022-08-12 09:13:09
33阅读
注意细节,不要越界,还有题目对英文不好的我,真是不友好,呜呜。题意:给你两种类型的卡车,一种体积是1,另一种是2,每辆车都是自己的载重量,现在给你一个体积,问你这个体积下,最大的载重量是多少?并给出方案车辆编号。思路:排序后预处理前缀和, \(O(n)\)枚举即可。代码如下struct node{
ll w;
int id;
}a[N], b[N];
ll s1[N], s2[N];
int
转载
2021-04-03 21:03:06
159阅读
2评论
题目:http://codeforces.com/problemset/problem/3/B大意是,给定N和V,在给出N个vehicle的类型号(1或2)和各自的
原创
2022-08-09 17:48:03
101阅读
题目传送门 正解 思路 因为物品的重量只有 1 和 2,所以考虑暴力枚举选择多少个 2 ,剩下的尽可能多地填充 1 即可。 为什么“尽可能多”正确呢?很显然,这是因为物品的价值 \(\ge 1\) 。 至于怎么选择,只需要将物品的价值从大到小排序,然后取靠前的即可。 注意使用前缀和优化。 代码 #i ...
转载
2021-10-23 09:21:00
25阅读
2评论
B. Lorry 题目连接: http://www.codeforces.com/contest/3/problem/B Description A group of tourists is going to kayak and catamaran tour. A rented lorry has
原创
2021-07-16 11:52:58
194阅读
hive库清表,删除数据 insert overwrite table lorry.bigdata select * from lorry.bigdata where 1=0 hive的simple模式 hive的select如果是fetch模式(select <columnname> from [
转载
2017-08-20 11:12:00
91阅读
2评论