CT34517

Warden's Busy Hall Ledger

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the ember dunes of Ashfall close for winter, Warden 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 <= 2230; 0 <= s < e <= 10^9.

Example 1:

Input: 718 400916907 400916939 375171819 375171847 760699794 760699866 528336428 528336465 98746247 98746334 199884806 199884863 320579237 320579319 225395505 225395516 973874274 973874331 915363099 915363190 52739065 52739148 724898494 724898550 240010977 240011071 280128343 280128396 78316892 78316925 676014926 676015015 969033314 969033374 802548932 802548983 453076475 453076557 581304053 581304056 309591556 309591558 856105278 856105323 91416436 91416504 56220095 56220174 783221297 783221301 245640307 245640371 976887077 976887137 498594208 498594293 364515578 364515617 993761213 993761272 82164158 82164170 409330848 409330914 925400428 925400516 946401162 946401244 407912664 407912747 515905316 515905365 321451889 321451975 882027693 882027768 827642647 827642691 777661911 777661949 85496419…
Output: 1

Example 2:

Input: 1368 858880793 858880877 291565758 291565766 380316780 380316856 107928155 107928212 207122380 207122480 341986270 341986300 320347753 320347835 388318398 388318408 581983375 581983471 22281525 22281616 619883789 619883836 272055953 272056043 248449906 248449992 958583080 958583138 808515776 808515836 85248931 85249012 943476837 943476896 551901961 551901965 859611354 859611400 370125860 370125862 54714202 54714252 278861835 278861896 699658727 699658797 962240483 962240531 570035240 570035263 421972943 421972949 90060308 90060372 237879150 237879157 590141691 590141736 858493459 858493483 810097956 810098044 152602510 152602574 166981190 166981260 937181150 937181228 15294779 15294812 276774982 276775055 454393883 454393945 171027348 171027366 479812237 479812336 877292393 877292455 27246…
Output: 1

Example 3:

Input: 1202 450149862 450149909 361180325 361180413 164636096 164636120 985385273 985385371 286343084 286343094 107554840 107554938 989683147 989683222 696264811 696264879 630900136 630900140 914838681 914838689 512056291 512056309 677053043 677053082 236985974 236986060 433985866 433985875 942289329 942289416 206410615 206410617 574604923 574604931 378698707 378698796 825271704 825271727 343224396 343224491 578371822 578371862 186241915 186241945 306753442 306753501 905896783 905896812 334861121 334861132 352784923 352784971 976507384 976507447 67929672 67929678 899696877 899696936 93856092 93856150 98378609 98378634 770003893 770003935 36981546 36981595 212396847 212396891 362900040 362900121 207084234 207084289 708079049 708079104 422698164 422698244 184045365 184045440 940297158 940297207 690…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Warden's Busy Hall Ledger - MEDIUM Coding Problem | CodeTikki