$N$ persons visited a restaurant. The restaurant is open from 0 to $T$. The $i$-th…
- User
persons visited a restaurant. The restaurant is open from 0 to . The -th person entered the restaurant at and left at . Find the maximum number of persons during the business hours.
Assistant
pythonn, t = map(int, input().split()) events = [] for _ in range(n): l, r = map(int, input().split()) events.append((l, 1)) events.append((r, -1)) current = 0 max_people = 0 for time, delta in sorted(events): current += delta if current > max_people: max_people = current print(max_people)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.