CT54055

The Radiant Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the maple sugarbush of Saprun. Kavya spreads the scrolls records across the table and picks up a sharp pencil. 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 <= 2534; 0 <= s < e <= 10^9.

Example 1:

Input: 1089 387725626 387725723 925068879 925068944 856784875 856784923 962136109 962136195 408498047 408498056 422919013 422919054 518328972 518329056 312961695 312961721 882586816 882586831 799652621 799652632 325136101 325136141 26182250 26182335 523675915 523675949 539098558 539098580 246337024 246337057 387958221 387958269 486151711 486151756 962843736 962843792 250194792 250194865 256626062 256626086 202037172 202037187 486960488 486960587 892095928 892095956 110291814 110291834 952548026 952548063 838381502 838381595 274097420 274097515 481653481 481653556 274662236 274662275 341264142 341264242 553884300 553884357 513329499 513329529 2428653 2428706 201093577 201093647 104568821 104568852 348064900 348064975 931008483 931008527 132543190 132543288 91548114 91548167 942148639 942148697 977…
Output: 1

Example 2:

Input: 1321 384371223 384371238 773977711 773977728 742130609 742130621 718113926 718114011 587449695 587449699 890667069 890667128 277340349 277340445 98099808 98099874 737795525 737795625 177935847 177935880 99102422 99102494 902261240 902261251 246305049 246305111 671443463 671443486 627925847 627925851 638871613 638871677 229444127 229444173 538379706 538379780 739852461 739852520 105842080 105842094 101930174 101930182 398765686 398765689 783534805 783534835 382542805 382542902 462551097 462551111 241908781 241908880 676760844 676760855 62076327 62076422 64090131 64090196 627918789 627918886 47222032 47222121 890052568 890052628 32447111 32447143 507829466 507829493 778105271 778105359 674499095 674499147 123102676 123102774 510744132 510744165 962943471 962943522 909808952 909809035 4402336…
Output: 2

Example 3:

Input: 1410 833474726 833474773 980191555 980191583 288540786 288540822 522790673 522790715 332403241 332403341 387311 387380 530061056 530061132 681904763 681904790 79485378 79485455 289359912 289359978 93949759 93949837 830033576 830033624 283152038 283152095 641742089 641742137 592765396 592765496 186272949 186272964 661495953 661496026 521452707 521452764 432273138 432273225 870834873 870834932 146958677 146958729 42750762 42750817 507395781 507395876 395012915 395012989 648457332 648457392 67009373 67009427 86979601 86979663 37915610 37915635 538343849 538343854 563375483 563375573 122751484 122751500 962001507 962001598 718206987 718207011 33429847 33429870 890851442 890851455 171216563 171216639 668040941 668041029 677811435 677811450 905018111 905018165 385586109 385586160 560806460 56080…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Radiant Busy Hall - MEDIUM Coding Problem | CodeTikki