#include <vector> #include <algorithm> using namespace std; struct Guest {int arrival, leave;} g[10]; bool cmp(int i, int j){ return abs(i) < abs(j); } void maximum_guest() { vector<int> time; for (int i = 0; i < 10; i++){ time.push_back(+g[i].arrival); time.push_back(-g[i].leave); } sort(time.begin(), time.end(), cmp); int n = 0, maximum = 0; for (int i = 0; i < time.size(); i++){ if (time[i] >= 0) n++ ; else n --; } maximum = max(maximum, n); cout << maximum << endl; }