蓝桥杯2020年第十一届国赛真题-答疑 C++ 排序 贪心 摘要:解题思路:在前面都选择花费总时间最少的 最后的答案一定是花费时间最少的注意事项:记得开 long long参考代码:#include<bits/stdc++.h>#define int long lo…… 题解列表 2024年04月08日 0 点赞 0 评论 578 浏览 评分:0.0
c++ 详细题解 摘要:解题思路:假设每一组输入分别为ai1 ,ai2 ,bi , Ai=ai1+ai2(每一组的时间总和减去离开教室的时间) , Ki=Ai+bi=ai1+ai2+bi(每一组的时间总和) …… 题解列表 2023年02月23日 0 点赞 1 评论 744 浏览 评分:9.9
短作业优先-答疑 ```cpp#includeusingnamespacestd;typedeflonglongll;constintN=1e3+5;intn;structnode{lls,a,e;}x[N];boolcmp(nodex,nodey){llsx=x.s+x.a+x.e, 题解列表 2022年03月14日 0 点赞 0 评论 813 浏览 评分:9.9
贪心求最小值 排序 #注意排序性先排每组元素总和,若相等根据每组前两个元素和,确定大小次序```#include#includeusingnamespacestd;constintN=1010;intn;structnode{intx,y,z;//x为每组3元素总和y为每组前两个元素和z为末尾元素值}a[N];boolc 题解列表 2022年02月22日 0 点赞 0 评论 756 浏览 评分:9.9