说是贪心,我更愿称其为动态规划吧 #include <algorithm> #include<iostream> #include <utility> #include <vector> using namespace std; bool compare(pair<int, int> a, pair<int, int> b){ return a.second < b.second; } int GreedForCounter(vector<pair<int, int>>&...