CT44291

The Busy Hall Beneath Thimblewick

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Deep in the wren hedges of Thimblewick, Pia studies rows of stretches entries. One clean number will settle the guild's oldest argument. 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 <= 2587; 0 <= s < e <= 10^9.

Example 1:

Input: 37 170337891 170337912 577880533 577880581 425121417 425121512 371540113 371540190 965067201 965067252 994492660 994492731 108674339 108674367 729291362 729291381 661634633 661634636 625704882 625704894 945768146 945768195 54691285 54691377 945762718 945762782 802966784 802966828 900864680 900864691 625015413 625015449 712348124 712348144 388643211 388643228 294378058 294378078 204079464 204079516 709486813 709486855 407016668 407016681 173038920 173038998 124500209 124500233 831067103 831067106 214180848 214180931 229578967 229579018 755326104 755326133 191798439 191798470 788778289 788778300 151163364 151163413 926188691 926188717 138055874 138055899 567893765 567893767 558272348 558272418 768339958 768340002 603266874 603266880
Output: 1

Example 2:

Input: 1139 151595911 151595961 649733760 649733764 640853636 640853709 584378702 584378754 734980204 734980262 146646086 146646146 859766110 859766181 875784811 875784832 836863032 836863075 813999673 813999743 416302389 416302416 398842133 398842206 901601530 901601574 289710747 289710818 82037186 82037209 703157939 703157972 663481864 663481918 674895352 674895383 508305404 508305448 683650743 683650767 696687277 696687303 898990869 898990930 314442480 314442496 659110582 659110619 254716549 254716607 499006302 499006356 766047723 766047769 318087535 318087549 421923075 421923136 331297628 331297694 766658361 766658386 451849717 451849740 725579510 725579572 36414210 36414259 786586143 786586230 707688117 707688199 566116248 566116256 251577405 251577436 886628736 886628811 775511459 775511511…
Output: 1

Example 3:

Input: 1858 329936596 329936626 509342105 509342183 655145250 655145283 67767526 67767547 312809727 312809808 181434901 181434937 80000093 80000134 979346525 979346597 963491486 963491490 446634073 446634117 136786443 136786511 187167595 187167658 57075298 57075354 978735509 978735591 470955362 470955385 326941066 326941164 909825724 909825733 997413735 997413826 121178181 121178257 556016136 556016195 185023702 185023797 890378573 890378655 557086045 557086137 794220324 794220395 730972860 730972879 160415910 160415940 681471443 681471465 183454951 183454963 505530963 505531006 497320347 497320407 519843194 519843217 129017028 129017061 396525056 396525141 843148944 843148993 20707920 20707992 172128930 172129019 823328319 823328341 687365948 687366026 836389798 836389874 968683465 968683478 149…
Output: 1

Constraints:

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

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