CT49215

Chandler's Busy Hall Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the clockwork quarter of Gearford, Chandler the registry keeper keeps careful count of the stretches. plan the beacon maintenance rota, every figure matters. 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 <= 1221; 0 <= s < e <= 10^9.

Example 1:

Input: 959 94055236 94055296 201158245 201158333 400471793 400471863 371488943 371489003 832156381 832156446 47170827 47170854 249687472 249687498 735089255 735089293 791413376 791413425 772851458 772851512 129305191 129305221 941011615 941011696 846135484 846135504 287957671 287957752 565480264 565480358 908211629 908211660 234599131 234599184 578203918 578204010 799739893 799739986 428353929 428353969 99040158 99040186 140174154 140174232 559057100 559057128 367511550 367511583 799030550 799030609 571163954 571163959 858437672 858437756 738511726 738511776 995852689 995852691 529980560 529980581 84245824 84245908 520572004 520572020 51973981 51973990 531427486 531427574 384390931 384390992 867958496 867958501 85633285 85633332 944916401 944916491 594178499 594178585 837665407 837665477 82276813…
Output: 1

Example 2:

Input: 638 968211179 968211239 409476355 409476380 949309250 949309266 126698920 126698980 642307878 642307906 427953413 427953455 830973241 830973309 911876924 911876943 185240334 185240357 737154398 737154492 326901247 326901346 54949398 54949443 50888479 50888559 866599690 866599706 68529375 68529394 386397328 386397348 583850004 583850102 721810973 721811062 967939843 967939909 616625330 616625369 844166701 844166743 75257359 75257443 542217479 542217509 108208679 108208715 794417946 794417953 592833 592883 338280755 338280775 7505457 7505482 57199561 57199630 862774735 862774827 990958478 990958567 837695851 837695923 164407182 164407230 369403126 369403170 578490067 578490143 514236953 514236965 489850094 489850110 266458049 266458119 600653470 600653505 94074933 94074959 980067106 98006712…
Output: 1

Example 3:

Input: 208 509937788 509937802 154777669 154777703 230072018 230072026 897838702 897838787 997293371 997293427 602188158 602188246 208839826 208839871 505298969 505299034 555567189 555567265 817813882 817813967 388140461 388140541 187156210 187156258 426588749 426588821 423275376 423275402 155329676 155329714 605896044 605896088 206842974 206843013 380758808 380758889 281874654 281874706 639020151 639020194 814959440 814959442 891473608 891473655 879141894 879141993 604790691 604790746 34497110 34497134 924232511 924232588 760585636 760585684 159987280 159987303 126550854 126550933 155041870 155041948 499117747 499117761 578096188 578096269 462551255 462551272 930098312 930098368 761537314 761537345 332034769 332034861 849430803 849430817 392886430 392886439 755633593 755633636 557454009 55745407…
Output: 1

Constraints:

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

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