CT48110

Cora's ribbons Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Cora inherited the exchange at the heron rookery of Longlegs along with its curious bookkeeping system for ribbons. Time to make sense of it. 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 <= 2054; 0 <= s < e <= 10^9.

Example 1:

Input: 990 656136066 656136111 281908773 281908860 635262712 635262807 122543139 122543207 708307056 708307139 114316738 114316799 370436554 370436616 961381646 961381700 915280195 915280238 420220683 420220735 139891247 139891253 446117819 446117820 504684165 504684203 486199328 486199377 670302900 670302978 876218547 876218572 83969541 83969571 603888433 603888492 564643363 564643429 323222234 323222310 395158523 395158555 118389857 118389935 732316873 732316884 494379276 494379336 387022181 387022253 914246627 914246674 711079866 711079933 941975902 941975963 554628123 554628154 740849203 740849215 185806306 185806400 955478270 955478356 379117330 379117414 728863635 728863644 535616085 535616122 416120810 416120873 159750504 159750534 761115504 761115542 762333551 762333602 14109659 14109681 …
Output: 1

Example 2:

Input: 1580 39710906 39710995 97546490 97546558 500306029 500306119 634778099 634778115 146285507 146285600 408532812 408532874 922600438 922600499 5336101 5336127 930713048 930713093 277403357 277403411 861038033 861038113 276237329 276237358 125665391 125665417 663893135 663893143 289924609 289924623 69585458 69585506 301572528 301572594 915302718 915302811 546789060 546789061 588821514 588821578 387460389 387460428 53887149 53887194 627958739 627958763 962622694 962622790 415739298 415739396 342371734 342371736 100150371 100150400 603537761 603537859 67221444 67221479 768680911 768680914 315266484 315266523 162298922 162299021 984676355 984676436 850087952 850087971 645775111 645775205 236410055 236410085 275100373 275100422 282069318 282069325 365394775 365394868 22552524 22552574 603951898 6…
Output: 1

Example 3:

Input: 1780 781677755 781677774 858787801 858787870 104613845 104613905 103661631 103661705 103243851 103243854 283727199 283727233 486143289 486143389 895446615 895446659 732800125 732800132 878308244 878308256 689565319 689565326 960979185 960979281 732586728 732586826 899348755 899348823 522604971 522605015 387780470 387780552 97913925 97913939 487715193 487715199 492117511 492117512 50471508 50471572 817433366 817433455 191639066 191639077 244520594 244520675 74521564 74521571 808143416 808143439 1552471 1552527 557684318 557684414 135102651 135102727 689887409 689887428 855442943 855443002 491567246 491567266 130267937 130268012 990783649 990783691 682396686 682396775 655816745 655816784 409377901 409377953 193473383 193473449 796099374 796099428 588755623 588755635 747630597 747630643 54722…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Cora's ribbons Reckoning - MEDIUM Coding Problem | CodeTikki