CT42988

The Busy Hall of Stonehallow

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the granite steps of Stonehallow close for winter, Morgana must finish the stretches ledger - one figure at a time. 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 <= 1948; 0 <= s < e <= 10^9.

Example 1:

Input: 182 216953830 216953870 588558223 588558298 311886403 311886462 428235793 428235867 9550024 9550103 211170166 211170168 602018552 602018615 601590548 601590608 720550427 720550515 338796164 338796230 930032421 930032473 227690012 227690077 790619031 790619113 876533885 876533956 698870099 698870171 309665565 309665584 77596591 77596615 609498534 609498606 68156723 68156761 253035883 253035966 524329530 524329536 805046521 805046604 88548313 88548376 985923104 985923171 706777857 706777903 772729660 772729661 286414905 286414943 422920031 422920045 546059667 546059724 787424099 787424180 679318660 679318663 166495675 166495770 22058406 22058440 647725365 647725379 638814525 638814602 444604297 444604301 918609916 918609922 63499384 63499405 914296348 914296354 436904802 436904887 466400024 …
Output: 1

Example 2:

Input: 1925 905318542 905318635 480094263 480094266 350641545 350641582 281791871 281791961 134054393 134054406 317765049 317765134 657828838 657828913 359061124 359061146 84541055 84541058 706357498 706357516 965955315 965955325 722076412 722076476 296516159 296516213 454382528 454382551 739145087 739145185 686697958 686697985 486490079 486490157 298126895 298126922 468594909 468594937 860452156 860452201 24866948 24866977 313177067 313177103 806516943 806516948 549303024 549303071 343462631 343462632 330772444 330772451 743553533 743553603 832195349 832195447 235647058 235647089 560085727 560085743 876962786 876962789 760689879 760689972 361338473 361338521 522096201 522096288 295685114 295685182 745941175 745941268 826284148 826284246 314429098 314429130 909546206 909546301 969273136 969273171…
Output: 1

Example 3:

Input: 1118 92319173 92319241 567335567 567335599 827278435 827278515 813854840 813854937 938454020 938454111 743461233 743461319 857095429 857095434 865419395 865419450 107523555 107523565 464901540 464901572 216781667 216781747 282836947 282837021 117563606 117563680 431461294 431461336 722319370 722319414 210147652 210147683 552767606 552767706 300058273 300058327 471241144 471241173 477025082 477025172 274091698 274091759 285309689 285309723 490668772 490668860 832482796 832482860 230135120 230135200 241787943 241787970 590730094 590730119 98737783 98737831 153999956 153999985 316282561 316282637 889092464 889092544 75836684 75836776 892815871 892815890 590030606 590030690 567846956 567846967 330188938 330188950 774219636 774219650 858794901 858794907 163772436 163772478 884150316 884150327 6…
Output: 1

Constraints:

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

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