CT35421

The Busy Hall Beneath Applerun

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the orchard lands of Applerun, someone must outscore the rival chapter. This year the task falls to Gardener, armed only with the scrolls register. 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 <= 2120; 0 <= s < e <= 10^9.

Example 1:

Input: 116 978404482 978404543 573357187 573357201 604697192 604697258 363194575 363194660 484436270 484436290 738164985 738165058 645795588 645795671 192470552 192470646 793594421 793594428 149677879 149677966 980572622 980572667 379545976 379546011 854397020 854397070 660790496 660790550 105696496 105696505 235770365 235770366 331149846 331149931 656614586 656614655 851608189 851608269 775335600 775335603 147915462 147915526 847120470 847120531 919266620 919266641 586945579 586945586 210565757 210565845 720838612 720838646 874556223 874556235 125999817 125999871 215189994 215190079 66478047 66478053 106081479 106081518 282012331 282012365 478208505 478208506 546140809 546140886 630987396 630987460 34493692 34493709 755850040 755850113 700138974 700139073 383255999 383256016 400126779 400126802 …
Output: 1

Example 2:

Input: 1874 491301621 491301626 341671121 341671221 251518137 251518236 788444595 788444609 816178372 816178451 635009755 635009855 795600995 795601092 486907574 486907633 653480005 653480093 66341787 66341862 657202664 657202716 909180633 909180655 60917484 60917515 605144986 605145023 838037352 838037405 704385613 704385684 641934418 641934443 843959068 843959166 924994045 924994118 456278145 456278192 734900738 734900740 987322407 987322450 42654126 42654209 494329802 494329868 679451655 679451728 369722772 369722863 201267576 201267612 733967338 733967389 688174613 688174624 326580520 326580530 313295675 313295737 693250428 693250495 520933282 520933318 152220203 152220206 939860991 939861072 368334043 368334068 259305020 259305073 250663006 250663079 544740477 544740539 402135880 402135918 7…
Output: 1

Example 3:

Input: 1570 665449476 665449486 255792946 255792960 715126314 715126396 291582124 291582161 489911958 489911978 981455427 981455512 968837314 968837369 691147885 691147963 682022078 682022110 557386424 557386464 442803782 442803804 626357282 626357338 910697694 910697722 219625829 219625885 380308865 380308891 610535632 610535727 191898521 191898550 828903757 828903770 142712936 142712970 960725958 960726001 863502795 863502879 132973728 132973796 390952092 390952111 669305515 669305603 822646558 822646610 53991030 53991114 370097878 370097961 782321557 782321639 909914398 909914404 148446218 148446271 281884640 281884704 570164552 570164650 804371196 804371251 255969666 255969680 627967807 627967808 68376806 68376889 872257569 872257583 182608770 182608841 655849597 655849648 74647008 74647034 1…
Output: 1

Constraints:

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

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