洛谷P1478 陶陶摘苹果(升级版) 题解 这道题只要会自定义cmp恰当地进行排序,其他部分没有什么大问题。 上代码: 1#include<bits/stdc++.h>2usingnamespacestd;3intn,s,h1,h2,cnt;4structapple{5intheight,ns;//height为苹果高度,ns是所需要的力气6}a[10000];7boolcmp(appl