CT38742

Draper's Polished scrolls

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the willow walks of Reedmarsh. Draper spreads the scrolls records across the table and picks up a sharp pencil. 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 <= 2613; 0 <= s < e <= 10^9.

Example 1:

Input: 204 115957027 115957052 706443837 706443862 920968891 920968961 621808399 621808432 672320689 672320757 57509922 57510016 106735744 106735806 909912587 909912658 585949036 585949071 568950956 568951020 600673640 600673642 198119939 198119997 84045930 84046001 628663677 628663775 921676457 921676533 94778236 94778319 645072091 645072101 688595830 688595929 375974066 375974156 141807442 141807462 134637165 134637209 490022590 490022671 671752308 671752341 277087103 277087112 591388708 591388790 241831981 241832032 191819116 191819122 530372686 530372768 885569617 885569690 960777314 960777319 756727125 756727157 818933559 818933582 339277257 339277278 216826831 216826886 477221622 477221643 25773965 25774040 294631634 294631729 9549428 9549527 931644098 931644150 617072651 617072748 65181344…
Output: 1

Example 2:

Input: 1563 594532417 594532480 486862576 486862577 309005471 309005515 76948878 76948931 931019491 931019522 7502652 7502721 144177252 144177340 868904790 868904846 906148481 906148535 323520583 323520611 367463284 367463318 500596581 500596585 57821477 57821567 735046686 735046741 902591567 902591645 450703847 450703931 187091109 187091208 898617688 898617736 138505768 138505795 60713281 60713351 15222455 15222546 592802559 592802581 114273793 114273842 730372389 730372455 145049102 145049160 253044723 253044814 440579345 440579364 477639801 477639873 442345490 442345547 301278233 301278261 875067083 875067142 991198475 991198548 328458714 328458774 621999612 621999702 680940890 680940956 429861773 429861805 804877353 804877398 337758132 337758162 898134899 898134968 902888527 902888531 1096196…
Output: 1

Example 3:

Input: 1367 895008774 895008835 792378673 792378763 217518536 217518557 741634559 741634580 277946810 277946833 753269265 753269302 243104542 243104544 261279035 261279124 303715733 303715745 847182469 847182482 201310726 201310761 328999257 328999341 217185232 217185254 191411798 191411829 4014734 4014755 616908331 616908397 248388721 248388735 877065231 877065248 491077196 491077282 637071514 637071612 823003177 823003210 591029969 591030023 985242825 985242899 653956825 653956861 451529820 451529829 573686594 573686636 175493473 175493520 618255572 618255604 207970935 207970945 472680118 472680190 704416678 704416737 111394696 111394785 168445701 168445785 414898227 414898247 349843003 349843042 777624822 777624916 872188161 872188234 288812196 288812204 383288081 383288168 744568527 744568532…
Output: 1

Constraints:

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

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