摘要:
OI-Wiki #include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <stdio.h> #include <string.h> #include <stdlib.h> //#pragma GCC opt 阅读全文
posted @ 2021-03-14 10:52
棉被sunlie
阅读(58)
评论(0)
推荐(0)
摘要:
重定义的时候就如写sort时的cmp一样,最后将return时候的">","<"反过来就行 #include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <stdio.h> #include <string.h> 阅读全文
posted @ 2021-03-14 00:47
棉被sunlie
阅读(110)
评论(0)
推荐(0)
摘要:
题链 贪心把使用优惠劵后价格前K个一一压入队列(以队列 QQ 表示)直到钱不够(可以证明前K个是一定要买的,因为最赚),其他未被压入队列的价格压入队列 Q 例如价格前K个中某个产品以原价购买+后K个某个产品以优惠价购买也是可行的情况 2 1 5 2 1 1000 3 则 QQ队列中以原价和优惠价的差 阅读全文
posted @ 2021-03-14 00:41
棉被sunlie
阅读(74)
评论(1)
推荐(0)

浙公网安备 33010602011771号