CT34186

The Busy Hall of Brineport

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

At the smokehouses of Brineport, Lata records each stretches in a worn leather ledger. The guild wants answers, not guesses. 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 <= 2745; 0 <= s < e <= 10^9.

Example 1:

Input: 2022 722984468 722984533 525272316 525272348 743638864 743638945 798904410 798904472 213878729 213878772 584874215 584874315 343937677 343937751 725310417 725310517 498585516 498585560 610865628 610865642 351851524 351851546 760801132 760801211 443689673 443689691 402176622 402176666 92026475 92026565 642425312 642425348 411006294 411006388 211184806 211184897 653379323 653379378 455523916 455523993 132092853 132092939 945604632 945604715 222564599 222564607 324555902 324555954 528706558 528706655 594131711 594131736 758105388 758105458 137953317 137953318 495475469 495475568 457470607 457470622 551931538 551931602 88559089 88559117 648659433 648659456 547453073 547453153 819586945 819587031 984309800 984309884 21190452 21190479 640496120 640496164 522899665 522899707 966799892 966799908 3…
Output: 1

Example 2:

Input: 1749 828931719 828931811 642135409 642135502 152520467 152520544 178444713 178444758 671201688 671201784 64113724 64113821 470946659 470946691 153761192 153761269 860042606 860042704 190732465 190732548 546351192 546351228 197662149 197662220 241384460 241384529 29210664 29210709 300186566 300186634 631686117 631686184 80690928 80690936 972101779 972101781 812331520 812331562 707973654 707973719 593005017 593005037 454494023 454494119 523981474 523981520 985704157 985704248 979873408 979873496 922461596 922461669 460412107 460412126 470959398 470959406 504919331 504919389 977597620 977597623 649686272 649686309 690527303 690527373 595419779 595419867 373638316 373638343 310179012 310179047 384741604 384741634 331812607 331812672 617878141 617878214 364934665 364934710 491602613 491602658 6…
Output: 1

Example 3:

Input: 2441 673570470 673570564 700077082 700077126 854814139 854814196 928729377 928729425 55284963 55284978 173173489 173173585 47783414 47783433 104851538 104851568 144609495 144609580 712286678 712286687 123623059 123623102 7501708 7501763 741687561 741687591 549547556 549547623 440983012 440983097 650728901 650728976 110263549 110263613 63046273 63046301 492992189 492992222 34242238 34242322 412649695 412649716 886322505 886322557 376813530 376813593 257438778 257438844 953105175 953105257 628510589 628510685 159069502 159069532 342845071 342845144 934327727 934327741 977578009 977578080 949108967 949109056 873696714 873696793 451602476 451602523 339558885 339558922 298842700 298842767 57357345 57357391 853151562 853151650 6335594 6335665 896435677 896435711 492984746 492984784 757717869 757…
Output: 1

Constraints:

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

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