CT33983

The Verdant segments of Lothar

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the smokehouses of Brineport close for winter, Lothar must finish the segments 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 <= 2592; 0 <= s < e <= 10^9.

Example 1:

Input: 1862 82735090 82735170 590371784 590371875 221375058 221375074 683761365 683761374 177705843 177705912 938992059 938992082 158030341 158030394 665465291 665465316 460806480 460806514 954933244 954933307 881012400 881012401 817777632 817777708 521000270 521000344 94788469 94788489 363766086 363766141 23401308 23401315 181972217 181972278 892359117 892359178 199448824 199448904 81854616 81854623 482471394 482471434 670496285 670496346 325267543 325267638 590255255 590255316 607162780 607162870 22454550 22454563 732545629 732545656 953106397 953106473 963344423 963344470 46561185 46561191 290472674 290472756 196257042 196257053 621266506 621266593 473162273 473162360 345593948 345594029 177511312 177511324 585169307 585169364 440238299 440238319 266957873 266957922 501808713 501808733 7629080…
Output: 1

Example 2:

Input: 2393 871210212 871210252 321940893 321940963 441626768 441626851 75149661 75149756 682068145 682068175 318250196 318250216 961779464 961779480 634432249 634432274 584141621 584141659 493257122 493257159 407748275 407748321 587151233 587151328 824548726 824548819 668492415 668492484 840864140 840864227 83380609 83380641 715280065 715280111 789709980 789710008 557917914 557917994 484180111 484180148 496270039 496270093 872665093 872665165 162794611 162794626 655857666 655857696 535368576 535368620 505755686 505755720 732548084 732548110 397167029 397167123 839805385 839805448 725959215 725959226 511577385 511577458 863009071 863009105 492116537 492116541 199540270 199540302 344806590 344806593 789022517 789022570 611563976 611564043 687369048 687369073 682370903 682371002 393635943 393636024…
Output: 2

Example 3:

Input: 996 98500777 98500785 56953280 56953293 800768928 800769022 422001578 422001634 538336916 538336983 739055099 739055158 45880498 45880554 329653762 329653855 742162171 742162210 569500841 569500921 831298375 831298439 175144206 175144280 670241231 670241261 58645939 58645969 388913216 388913252 379098047 379098069 850444259 850444300 253577106 253577135 757621731 757621756 501282251 501282333 10808899 10808983 608923814 608923836 866013229 866013300 117196582 117196676 482954335 482954406 323468425 323468465 134450168 134450244 127972101 127972123 905711353 905711371 118189346 118189415 856080828 856080831 74643937 74644027 49788676 49788738 516318769 516318850 816998148 816998169 946735876 946735877 432007155 432007177 555913111 555913182 61245711 61245754 901661810 901661871 708645350 70…
Output: 1

Constraints:

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

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