CT41619

The Busy Hall of Whitesnow

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Caravans arrive at the tundra station of Whitesnow with crates of scrolls, and Forester the tallyman must account for every last one. 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 <= 1356; 0 <= s < e <= 10^9.

Example 1:

Input: 208 916902173 916902272 748466095 748466186 976588931 976589005 524748712 524748766 474238026 474238122 54472117 54472205 881795829 881795845 430568464 430568504 126158596 126158673 649997905 649997958 45376518 45376600 585957282 585957325 724374886 724374896 559971114 559971138 153527064 153527127 283855257 283855305 514505965 514506058 148672101 148672143 608154105 608154181 163729639 163729708 677756630 677756689 558844259 558844344 237796212 237796285 200768144 200768226 277111352 277111391 970961391 970961472 491449707 491449740 953652954 953653042 158534624 158534655 114980851 114980902 713348333 713348390 31045104 31045116 118582098 118582116 556141004 556141023 553400969 553401062 534390059 534390106 919307590 919307652 937672732 937672736 131521693 131521776 467856868 467856965 26…
Output: 1

Example 2:

Input: 644 909288614 909288616 581824025 581824097 525573865 525573916 702366099 702366126 652337059 652337132 628207825 628207864 435187850 435187941 213346621 213346675 215508842 215508879 82142797 82142858 338130421 338130441 923518378 923518400 997824533 997824614 794760570 794760634 222087185 222087201 285417948 285418039 810188373 810188387 589441916 589441934 558791472 558791537 25274565 25274664 809008689 809008716 630062123 630062209 440840031 440840034 921741639 921741708 908288195 908288245 746631220 746631263 150208503 150208546 540228595 540228691 106302571 106302660 462025719 462025732 980727737 980727793 939075091 939075103 764048357 764048370 505269685 505269784 422655261 422655305 83990672 83990756 284872524 284872557 235164112 235164117 746870390 746870466 246674285 246674309 76…
Output: 1

Example 3:

Input: 141 56681185 56681259 449712779 449712876 511132353 511132408 111811049 111811086 493093853 493093918 262762568 262762620 392930335 392930418 605132871 605132891 654097459 654097468 845245822 845245868 714564027 714564060 343290616 343290666 27001671 27001707 261171305 261171359 872987578 872987589 380791184 380791260 414992849 414992859 772948341 772948371 333473090 333473096 767613650 767613719 830102920 830103020 338922593 338922658 695015989 695016076 991607125 991607126 173781351 173781419 957058334 957058350 772209609 772209655 303925083 303925098 479566920 479567010 735857212 735857220 555356533 555356541 824914036 824914118 254144986 254145026 351018632 351018703 240286150 240286195 190105907 190105957 328669205 328669239 335141252 335141278 598502331 598502407 910686258 910686296 …
Output: 1

Constraints:

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

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