CT35147

Lila's scrolls Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the eel marshes of Slitherwick close for winter, Lila must finish the scrolls ledger - one figure at a time. 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 <= 2485; 0 <= s < e <= 10^9.

Example 1:

Input: 1297 758670308 758670364 883448047 883448097 648704201 648704243 446790637 446790675 288946100 288946154 808305099 808305170 608773970 608774003 458842416 458842430 167045941 167045977 384333618 384333661 70247988 70247993 206350853 206350907 962048406 962048453 231747378 231747463 665094691 665094748 415404071 415404100 725180395 725180417 949750736 949750752 438292068 438292105 864563668 864563730 205289650 205289747 826752662 826752707 655689733 655689813 502703498 502703565 964193222 964193318 531744587 531744671 751475881 751475912 231064726 231064757 393138104 393138122 764233309 764233383 290362483 290362512 130656831 130656870 666744978 666744991 402347920 402347962 328302446 328302501 491731757 491731763 10302595 10302656 385743867 385743928 667508943 667509006 296264539 296264561…
Output: 1

Example 2:

Input: 2390 846615174 846615225 728957056 728957105 648656827 648656910 908010684 908010706 512587473 512587558 374372400 374372437 374089498 374089529 261992842 261992938 608412713 608412778 184143300 184143321 960694090 960694094 143807813 143807829 347869135 347869154 880328615 880328684 87789524 87789576 347225306 347225326 567954985 567955075 928327997 928328046 335065990 335066016 388228670 388228728 207058780 207058874 390271942 390272031 297156016 297156071 8218635 8218637 599450084 599450093 245512157 245512181 905271174 905271253 860907455 860907480 223568278 223568349 786081173 786081232 772046211 772046274 368843056 368843075 774302223 774302263 159892657 159892683 943877221 943877318 370914540 370914604 663450078 663450099 508377083 508377145 637448195 637448263 145070705 145070759 2…
Output: 1

Example 3:

Input: 953 985875250 985875320 327352895 327352922 511561259 511561352 581082603 581082637 270055727 270055791 657644936 657645014 992687162 992687211 494203451 494203459 662981053 662981146 788475359 788475364 74277615 74277712 647493421 647493431 682707542 682707615 299221497 299221549 315789317 315789347 829836122 829836174 341004699 341004734 538576391 538576423 421219683 421219772 790741763 790741854 909916396 909916453 399281414 399281506 366993436 366993493 65977680 65977726 481186334 481186348 174789035 174789046 736452795 736452841 924992025 924992116 570936593 570936676 65943580 65943634 475563582 475563619 253485528 253485529 7415030 7415085 932781296 932781396 315921247 315921305 92037779 92037866 452010601 452010701 170973411 170973414 58069584 58069637 436571463 436571542 368599111 …
Output: 1

Constraints:

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

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