摘要: 题目链接:https://www.luogu.com.cn/problem/P1208 解题思路: 本题基于如下贪心思想: 优先选择单价便宜的。 所以我们按照单价从小到大排序,优先选择单价小的就可以解决这个问题了。 示例代码: #include <bits/stdc++.h> using names 阅读全文
posted @ 2021-02-03 12:18 quanjun 阅读(470) 评论(0) 推荐(0)