CT47397

The Sterling segments of Nina

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the tundra station of Whitesnow as Nina unrolls the day's manifest of segments. The tally will decide the next shipment. 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 <= 2680; 0 <= s < e <= 10^9.

Example 1:

Input: 2096 317101222 317101307 408841050 408841133 57038070 57038124 206793665 206793753 651625826 651625861 316897088 316897139 410765773 410765810 280979946 280980045 701133289 701133338 71183494 71183495 992123186 992123278 185150566 185150618 523127216 523127298 278217840 278217887 730931759 730931829 864141913 864141957 245183491 245183503 863956758 863956837 439394193 439394271 489514987 489515023 589473721 589473790 424120873 424120956 976175978 976176061 119917257 119917302 466161772 466161831 780235283 780235294 872938583 872938620 747878967 747879007 372711280 372711345 730625833 730625874 843629129 843629165 42661243 42661259 731627786 731627860 259476537 259476634 270008009 270008064 127433197 127433269 248786830 248786901 881860527 881860610 755176792 755176834 59120591 59120671 123…
Output: 1

Example 2:

Input: 2321 268745101 268745154 107259261 107259351 236232451 236232527 475397215 475397223 101468981 101469040 241956740 241956801 921585973 921586072 490234172 490234211 132291743 132291798 350698668 350698704 366076864 366076901 560200984 560201037 925591153 925591229 575413951 575413995 317799529 317799589 215143467 215143480 145401690 145401714 488802733 488802738 901949522 901949574 597727502 597727592 66424447 66424546 100820228 100820268 910585536 910585575 955591537 955591542 255247906 255248003 340440944 340440977 950050234 950050323 528205909 528205980 78639585 78639673 374352429 374352475 628772333 628772336 233530703 233530771 280753800 280753856 381813815 381813860 153313349 153313387 846127033 846127127 263011623 263011658 451473927 451473977 911120849 911120883 412128717 412128798…
Output: 1

Example 3:

Input: 1983 728773607 728773695 566961512 566961541 775155190 775155204 163148040 163148114 554340212 554340229 222979849 222979904 37038869 37038878 72967084 72967153 331387588 331387592 908937795 908937867 229816256 229816295 118144514 118144571 961369656 961369748 888092819 888092914 184081090 184081164 344813515 344813583 401751825 401751922 408731787 408731819 743493919 743493931 915725128 915725227 625722320 625722391 312780880 312780955 982427582 982427675 898040620 898040685 985737149 985737153 178585530 178585570 858401290 858401323 991888488 991888499 585295182 585295184 987644753 987644813 672138421 672138493 293090201 293090249 562045273 562045292 959066364 959066452 583040816 583040886 955751048 955751110 244074215 244074314 569623398 569623471 918407845 918407877 198400618 198400640…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Sterling segments of Nina - MEDIUM Coding Problem | CodeTikki