$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_count = 0 for t, delta in sorted(events): current += delta if current > max_count: max_count = current print(max_count)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.