CT42197

Manav's panels Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Manav runs the studio at the canyon post of Redrock. Today the books show a list of panels, and the numbers must be worked out before sundown. 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 <= 1472; 0 <= s < e <= 10^9.

Example 1:

Input: 1182 269487569 269487571 684773111 684773189 697329738 697329788 367871057 367871110 705652168 705652204 794707367 794707420 650262370 650262467 986453871 986453966 127824186 127824248 989568215 989568314 350087703 350087743 943965529 943965627 493690805 493690855 431192288 431192340 908416481 908416537 628349489 628349492 720246409 720246436 669150606 669150608 903721851 903721878 634277813 634277885 371735475 371735569 651086621 651086627 511040108 511040190 298973867 298973893 429952216 429952251 788360997 788361000 432717742 432717781 511416703 511416729 556017570 556017641 743027163 743027262 1014109 1014178 336309291 336309355 989770966 989771032 99971277 99971288 168923780 168923875 786813565 786813630 969552535 969552628 810634934 810634954 782574383 782574467 997881305 997881359 5…
Output: 2

Example 2:

Input: 811 744036357 744036405 490423165 490423239 988810535 988810593 326392133 326392199 638681044 638681088 350167582 350167668 724049788 724049872 962107368 962107409 589793461 589793512 74821951 74822043 41062769 41062801 148595623 148595707 681902077 681902119 365555176 365555180 833002071 833002160 578388530 578388588 78594498 78594584 124542664 124542743 698649471 698649570 785554409 785554412 67836498 67836518 987637924 987637957 537941910 537941940 720064671 720064767 37264184 37264265 519779573 519779655 843347580 843347593 121223078 121223161 604465897 604465900 968199925 968200007 732024906 732024947 329534140 329534143 807888297 807888344 129774344 129774422 770797609 770797623 515507289 515507376 509920208 509920224 524160818 524160831 796255364 796255464 553824092 553824093 308097…
Output: 1

Example 3:

Input: 305 12889280 12889353 684592136 684592230 136502135 136502194 914379541 914379582 476141321 476141370 165083069 165083104 154837254 154837275 843387414 843387422 910066277 910066329 816567696 816567791 21723162 21723185 650776575 650776667 678001615 678001698 111773871 111773934 204056202 204056212 642540944 642540981 93975762 93975842 196637144 196637205 41653663 41653721 632224764 632224789 132314206 132314212 207247727 207247822 791945771 791945870 61035448 61035467 276237141 276237147 728580183 728580259 935551398 935551435 489244406 489244410 979187993 979188011 536245607 536245654 451524006 451524033 107262531 107262592 908713116 908713123 813972822 813972849 222016372 222016386 899869551 899869625 407666667 407666680 886665899 886665949 790139727 790139764 355598669 355598704 797269…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Manav's panels Reckoning - MEDIUM Coding Problem | CodeTikki