查找小于等于某个数的最大值 把lower_bound改为upper_bound即可
set定义为倒序排列
set<int, greater<int>> s;
s.insert(1);
s.insert(3);
cout << *s.upper_bound(2) << endl; //1
正常定义
set<int> s;
auto it = s.lower_bound(x);
if(it == s.begin()) {
cout << "not found";
} else {
it--;
cout << *it;
}