CT34012

The Radiant Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Hope inherited the mill at the garden city of Petalbrook along with its curious bookkeeping system for segments. Time to make sense of it. 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 <= 2300; 0 <= s < e <= 10^9.

Example 1:

Input: 1247 73492961 73492965 82690074 82690094 185802173 185802179 967322048 967322085 250668894 250668965 495597058 495597132 713539823 713539839 598306190 598306200 994873824 994873845 380256873 380256901 802002188 802002229 586998092 586998191 782472288 782472350 520320406 520320487 683458423 683458465 524045854 524045878 669373367 669373388 220764702 220764762 927688887 927688943 700916165 700916214 187388326 187388421 492275987 492276045 929337133 929337167 487393739 487393819 996238922 996238961 47885866 47885938 435298280 435298362 736375399 736375435 552296444 552296472 198993783 198993849 74971021 74971055 35004440 35004531 189574154 189574166 324954544 324954642 502554357 502554396 309939496 309939503 377916478 377916496 967482188 967482241 532630370 532630375 511403409 511403461 27491…
Output: 1

Example 2:

Input: 567 834469114 834469184 272577568 272577619 659663512 659663535 222314605 222314680 796587255 796587291 553571832 553571852 827323333 827323379 492273355 492273416 663676684 663676731 853226435 853226455 8719330 8719389 162229512 162229552 848489907 848489957 916456378 916456428 846872243 846872247 737136596 737136611 618028068 618028077 414025133 414025217 542752106 542752123 316511808 316511859 434865119 434865124 443449865 443449946 892800803 892800891 316363356 316363359 816322834 816322853 238195467 238195486 156727494 156727520 360729872 360729914 919545323 919545324 303035065 303035078 550275138 550275195 232092252 232092332 919617622 919617678 402193164 402193241 460882771 460882793 252277426 252277486 643110748 643110798 615977080 615977090 152412499 152412597 427639576 427639657 …
Output: 1

Example 3:

Input: 952 82397808 82397883 643728193 643728211 127872838 127872925 570276083 570276127 673182591 673182613 626125944 626126003 361993154 361993198 786730478 786730520 183956988 183957066 917245365 917245383 621602605 621602673 680663946 680664011 205788670 205788765 58784799 58784864 976808115 976808168 653563636 653563713 133496901 133496971 775597876 775597955 918236867 918236938 799317591 799317648 865610169 865610206 964345052 964345145 609196948 609197040 383741096 383741138 817158843 817158864 825328288 825328377 610793163 610793175 924416669 924416696 508192797 508192885 73713349 73713392 151526844 151526849 720086560 720086620 700379827 700379885 898051213 898051217 269801023 269801123 768876912 768876961 648530334 648530406 640409659 640409725 625690377 625690393 560865128 560865180 63…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.