CT47176

The Busy Hall Beneath Ashfall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Anaya the chronicler watches over the ember dunes of Ashfall's stores of segments. A careful computation stands between order and chaos. Task: n crews each guard a half-open interval [s,e). An interval ending at time t does not overlap one starting at t. Print the maximum number overlapping at any instant. Input format: First line: n. Next n lines: s e. Output format: Print the maximum simultaneous overlap. Constraints: 1 <= n <= 2511; 0 <= s < e <= 10^9.

Example 1:

Input: 2 620979459 620979461 796561587 796561589
Output: 1

Example 2:

Input: 905 219897882 219897937 343002623 343002663 946662470 946662477 266810909 266811002 13498772 13498840 508158438 508158464 528545114 528545169 439132395 439132407 324043588 324043604 497420979 497421047 389707730 389707788 574209379 574209410 588135240 588135288 538649039 538649127 638823179 638823265 163680713 163680719 813676593 813676676 439762489 439762561 519666128 519666145 320894214 320894292 809034852 809034946 691746791 691746872 918978896 918978964 369921723 369921775 407262629 407262706 591283605 591283641 521006025 521006119 244119441 244119535 116836488 116836524 556849592 556849692 157627089 157627151 785181511 785181536 398251070 398251095 350019546 350019589 400620243 400620280 228601361 228601365 928200698 928200793 787454967 787454970 419146946 419147022 141533669 14153367…
Output: 1

Example 3:

Input: 306 876714678 876714778 425870058 425870149 570646968 570647039 325531493 325531529 659862710 659862755 904661171 904661242 95859887 95859912 119309475 119309477 8828620 8828658 683459241 683459327 485384851 485384860 828421694 828421762 700591520 700591600 342699320 342699403 520063631 520063718 83180553 83180568 425253215 425253232 527095067 527095145 645081294 645081323 825713369 825713450 919295268 919295319 876299886 876299912 193356777 193356815 143615018 143615034 212940254 212940337 389876593 389876622 158415697 158415763 445821860 445821901 801944433 801944458 610043133 610043183 492735497 492735521 841285164 841285263 328021021 328021044 248257500 248257579 662809677 662809745 139310664 139310746 903546540 903546610 479029256 479029272 423760144 423760188 827276172 827276213 4774…
Output: 1

Constraints:

1 <= n <= 2511; 0 <= s < e <= 10^9.

Loading...
Test Cases:No test cases
No test cases available.
The Busy Hall Beneath Ashfall - MEDIUM Coding Problem | CodeTikki