CT50342

Xanthe's Sterling stretches

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the snowberry thicket of Winterholt; Xanthe weighs the day's stretches manifests and starts the calculations. 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 <= 2579; 0 <= s < e <= 10^9.

Example 1:

Input: 2097 600768898 600768992 913218923 913219020 793525895 793525926 924929430 924929475 625297863 625297913 469054377 469054401 675749738 675749807 177381143 177381175 837974463 837974506 894517228 894517305 627464519 627464559 221339345 221339356 3124438 3124505 45705749 45705781 182467786 182467813 260371378 260371397 494974497 494974534 364378516 364378519 747398289 747398325 279785752 279785773 24829936 24829970 523044318 523044325 963232522 963232541 802039855 802039945 311401951 311402013 69612986 69613060 764815101 764815179 293944176 293944275 894579536 894579565 48584156 48584234 548963617 548963644 484122620 484122633 445449660 445449755 874987639 874987685 380832917 380833008 749436428 749436527 372687904 372687922 190598469 190598557 381756512 381756588 263110372 263110373 3698820…
Output: 1

Example 2:

Input: 2223 736522369 736522410 874384546 874384614 991023397 991023424 822227869 822227962 446692100 446692177 539910953 539910998 120885225 120885239 159291338 159291425 272701793 272701877 106738318 106738349 30691366 30691448 187724112 187724154 431437266 431437363 169612131 169612218 25869025 25869090 150613667 150613749 225766375 225766465 541388153 541388162 3030136 3030167 301845717 301845737 966959793 966959822 979311331 979311336 88592526 88592623 848767162 848767196 578533404 578533498 866273748 866273825 969166035 969166053 864616071 864616114 767599904 767599939 899427987 899428050 982293228 982293241 450419766 450419829 891553260 891553332 348729092 348729187 665776385 665776439 611944666 611944747 737360350 737360380 281723775 281723807 275568850 275568909 567933656 567933686 99928…
Output: 1

Example 3:

Input: 232 93791387 93791413 682113321 682113382 867358874 867358933 925482305 925482381 69279389 69279416 841619225 841619228 629567346 629567351 577757415 577757426 705772309 705772338 169764713 169764743 419820790 419820869 496889079 496889165 996239001 996239071 794993659 794993734 419865913 419865963 578713148 578713167 532629897 532629936 461664687 461664767 11611182 11611200 340364295 340364348 546960487 546960530 393009919 393009928 747148415 747148463 390910622 390910626 650238761 650238788 632799270 632799351 578225024 578225034 300001798 300001890 563679057 563679126 57317156 57317235 860457045 860457075 916838524 916838554 403047540 403047617 520867973 520867985 427246295 427246388 602492689 602492763 916043840 916043909 279001197 279001285 887078812 887078842 121111400 121111447 2107…
Output: 1

Constraints:

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

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