CT33684

The Busy Hall Beneath Silkmead

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

At the mulberry rows of Silkmead, Zaid records each panels 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 <= 1736; 0 <= s < e <= 10^9.

Example 1:

Input: 800 647892303 647892377 704325130 704325206 357218293 357218343 993685263 993685332 806276271 806276282 631299919 631299972 676431453 676431463 477158935 477158974 328874036 328874093 912504726 912504796 68113788 68113828 339883251 339883291 757048206 757048222 139858312 139858403 18689719 18689766 466422052 466422128 186025489 186025551 816124721 816124786 300600866 300600915 521975389 521975452 994153266 994153334 290576634 290576662 378897689 378897784 778937242 778937316 378604743 378604745 597377956 597378013 806166898 806166988 725290098 725290145 318198625 318198705 304667093 304667180 636488344 636488388 575802495 575802532 269190755 269190807 96803187 96803249 391706221 391706247 796555076 796555152 486244024 486244105 575415693 575415721 521989549 521989625 957078845 957078938 81…
Output: 1

Example 2:

Input: 1459 746568148 746568163 27892764 27892825 510094069 510094149 80946696 80946702 561384698 561384733 845976077 845976156 936717751 936717774 186058973 186059058 653566100 653566181 226854245 226854247 813157650 813157723 149084814 149084910 193986047 193986130 663380984 663381045 689859606 689859623 535447165 535447213 879481094 879481131 245780784 245780826 162303006 162303064 887561393 887561429 901233709 901233726 328675218 328675225 210032355 210032421 176986129 176986202 355259294 355259304 608500399 608500420 923183055 923183072 967041521 967041602 31721340 31721406 173012652 173012709 649550662 649550733 605203165 605203187 777605979 777606021 455027769 455027785 718486410 718486463 203933520 203933542 917207706 917207744 317610936 317610978 637728482 637728524 570904918 570904929 9…
Output: 2

Example 3:

Input: 99 908056603 908056696 945856353 945856443 714023181 714023258 712945459 712945513 776193678 776193681 505025297 505025387 908468861 908468875 920101612 920101671 395413494 395413515 230236871 230236955 649024045 649024080 489235715 489235734 392698608 392698688 542578279 542578280 20665119 20665214 202089196 202089217 601407420 601407489 136400986 136401083 163258668 163258695 183737468 183737510 697506774 697506862 535688061 535688062 216415788 216415811 904913469 904913555 224062131 224062166 784426448 784426547 102163904 102163919 268016241 268016337 212837925 212837926 759246501 759246508 324799905 324799935 543146529 543146551 157350019 157350115 253141561 253141634 124430418 124430463 398625328 398625396 400148822 400148881 592388420 592388428 987687060 987687114 36846238 36846305 4…
Output: 1

Constraints:

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

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