CT39558

The Copper Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Alaric found an old ledger of ribbons in the exchange attic at the alabaster quarry of Whitestone. The margin notes pose a precise question. 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 <= 1848; 0 <= s < e <= 10^9.

Example 1:

Input: 1036 486076066 486076117 980635546 980635620 416833506 416833579 954085729 954085780 483273051 483273060 926889479 926889539 162509015 162509042 382253487 382253568 836997495 836997498 907085300 907085327 307595762 307595857 18663508 18663581 440797899 440797955 252164357 252164411 806024742 806024773 818748422 818748522 353925786 353925801 94504426 94504427 893932873 893932960 238860415 238860472 119295890 119295915 550665827 550665859 924973283 924973349 12663177 12663180 464207640 464207732 510488260 510488334 876424314 876424395 617765696 617765709 321456014 321456079 257509457 257509554 974687194 974687236 566269583 566269598 729583964 729584009 619474503 619474594 744565934 744565984 856210851 856210935 464544902 464544920 928969770 928969834 72042677 72042750 918440294 918440325 759…
Output: 1

Example 2:

Input: 1236 485077291 485077374 150296418 150296448 554591905 554591935 568854867 568854948 198494788 198494797 197789562 197789564 396471045 396471070 885309697 885309748 966204480 966204520 470164719 470164742 29003196 29003205 467810382 467810413 382700146 382700184 551142474 551142484 444954469 444954487 56094205 56094256 16906442 16906453 610866413 610866464 23973452 23973550 904852456 904852516 769849258 769849321 131935886 131935977 687643509 687643567 542040110 542040200 569990298 569990391 290735878 290735890 300171256 300171263 672358688 672358741 410362018 410362067 85261985 85261993 771455439 771455485 654043326 654043361 488864276 488864337 201227999 201228013 501011297 501011322 855097218 855097230 418378039 418378075 147003428 147003494 403114025 403114069 724188315 724188414 36327…
Output: 1

Example 3:

Input: 1715 968771755 968771830 94295343 94295425 650899520 650899549 374614487 374614514 450555084 450555091 731317150 731317249 854099472 854099531 592166968 592167009 249363977 249364048 850781002 850781045 439872463 439872555 118669797 118669850 755512834 755512885 18329455 18329502 803686435 803686520 88967525 88967604 873444255 873444276 627576817 627576895 514163194 514163221 128049433 128049438 12689126 12689158 417687605 417687670 595817018 595817106 485304291 485304320 339574101 339574181 313833492 313833496 890360261 890360290 95274546 95274641 3940416 3940455 64871430 64871522 556649623 556649660 305255809 305255810 884388828 884388837 127161895 127161906 727442631 727442687 285223811 285223881 422636089 422636135 114298169 114298177 614900664 614900730 526898154 526898196 119997823 1…
Output: 1

Constraints:

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

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