典型例题 https://www.luogu.com.cn/problem/P1855 #include<bits/stdc++.h> #define MAXVAL 100005 using namespace std; struct good { int p; int w; int v; good():p(0),w(0),v(0){}; }; bool cmp(const good& a, const good& b) { if(a.v != b.v) return a.v>b.v; else return a.p&lt...