bool cmp(int x, int y)
{
return x > y;
}
int findContentChildren(vector& g, vector& s) {
//从大到小排序
sort(g.begin(),g.end(),cmp);
sort(s.begin(), s.end(), cmp);
int count = 0;
while (true){
while (true){
int num1 = g.size();
int num2 = s.size();
if (num2 < 1 || num1 < 1) return count;
if (s[num2 - 1] >= g[num1 - 1]){
count++;
s.pop_back();
g.pop_back();
}
else{
s.pop_back();
}
}
}
return count;
}



