CT47267

The Busy Hall of Sunspire

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Caravans arrive at the temple city of Sunspire with crates of stretches, and Cora the surveyor 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 <= 2564; 0 <= s < e <= 10^9.

Example 1:

Input: 967 2341704 2341758 635491342 635491401 887501078 887501082 483066104 483066126 432889604 432889650 4157860 4157878 953154210 953154257 49220572 49220653 92060635 92060732 657187769 657187839 599346847 599346876 624803963 624804002 646674027 646674048 649006768 649006778 260618979 260618990 483837056 483837129 76485354 76485412 998904858 998904921 912718984 912719069 14566819 14566917 88239257 88239264 195654574 195654598 391939422 391939451 368194943 368194972 371662041 371662083 271645773 271645839 209367089 209367165 858900970 858901047 607603369 607603402 872427650 872427657 193106400 193106498 439487950 439487982 991450601 991450652 826120187 826120253 865456535 865456610 471155466 471155515 89606349 89606423 963418212 963418296 252147666 252147674 802908722 802908731 923974431 923974…
Output: 1

Example 2:

Input: 1874 96536281 96536311 931307458 931307553 399080638 399080689 253056708 253056770 604067603 604067699 494036121 494036165 671331868 671331909 736672649 736672685 7582360 7582454 967470045 967470125 329904781 329904872 470857398 470857497 76494409 76494507 289275187 289275283 786219517 786219519 152587042 152587092 616761891 616761966 65238140 65238149 78460695 78460748 882846642 882846687 186085821 186085873 372860584 372860588 72746427 72746451 75123323 75123401 171779727 171779773 33546901 33547001 994893540 994893551 234654243 234654261 458966202 458966252 727731992 727732068 592542634 592542696 25285837 25285864 897044903 897044995 448822899 448822923 74605113 74605205 207721635 207721656 367783771 367783797 792797248 792797335 977363328 977363427 174887606 174887692 345131121 3451311…
Output: 1

Example 3:

Input: 1014 326262596 326262629 672194722 672194768 413714739 413714746 117248491 117248524 904837901 904837906 422712948 422712967 769956293 769956330 262213730 262213742 191886847 191886945 669137515 669137537 275991907 275991932 518777001 518777066 856688747 856688823 292443964 292444014 449073502 449073546 831065061 831065068 229401120 229401146 655038160 655038176 733674977 733674980 218784813 218784889 753992701 753992787 507388790 507388794 167589907 167589986 569155673 569155744 388654802 388654856 730625171 730625255 793687817 793687843 496116005 496116040 929842017 929842049 388601112 388601160 792752577 792752669 390152719 390152754 853001810 853001901 667234 667284 689982344 689982440 852310281 852310355 941456824 941456886 893694445 893694510 376738264 376738319 554215523 554215586 9…
Output: 1

Constraints:

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

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