CT50672

Last panels of Admiral

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the herring shoals of Silverfin close for winter, Admiral must finish the panels 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 <= 2683; 0 <= s < e <= 10^9.

Example 1:

Input: 1810 439872911 439872913 421590143 421590227 104046856 104046862 978627936 978627946 73322359 73322433 710468925 710468980 784741681 784741695 589729164 589729187 446418916 446418955 839004631 839004655 840402848 840402859 421924056 421924082 435180580 435180627 738439690 738439726 145766856 145766901 352432471 352432566 797714143 797714193 32050641 32050711 253273627 253273637 887932192 887932245 399838926 399838959 549954970 549954990 988148574 988148637 802305205 802305257 914748505 914748519 303809034 303809058 382549899 382549936 894201368 894201377 924602349 924602430 971054735 971054762 372945618 372945642 842429925 842429935 462407951 462408001 273171994 273172076 447164815 447164885 526398994 526398999 201039480 201039523 55391959 55391979 742304330 742304416 851126040 851126133 9…
Output: 1

Example 2:

Input: 2340 898773520 898773522 163841105 163841192 269002119 269002158 16429034 16429081 978804670 978804760 234856976 234856997 870639741 870639831 174029423 174029436 571047895 571047918 323368484 323368540 18132517 18132540 571283223 571283289 564825038 564825126 898244226 898244236 175096136 175096195 188009057 188009058 864025182 864025245 296419157 296419240 173175460 173175553 258723695 258723768 694656610 694656643 969633595 969633636 8242258 8242305 577498634 577498679 996160070 996160146 653288187 653288189 77975375 77975455 714417401 714417473 86584164 86584216 713368789 713368852 166594053 166594082 387087151 387087232 775729189 775729252 102383296 102383363 811667811 811667909 902551988 902552047 142106946 142107029 762857092 762857158 387560056 387560101 866844552 866844615 9015430…
Output: 1

Example 3:

Input: 2358 180306864 180306950 87719284 87719297 171545909 171545999 336691438 336691516 680418183 680418243 923474935 923474975 982507687 982507720 300307476 300307520 832264081 832264136 847362997 847362998 267258233 267258327 362293579 362293616 798380065 798380097 192995864 192995896 823556288 823556360 832632 832637 208772843 208772890 813035539 813035589 418072099 418072155 367599541 367599599 747440056 747440101 763448104 763448175 938757891 938757989 736376915 736376971 592658114 592658173 953406800 953406876 659140326 659140409 790255829 790255862 210241489 210241520 106843066 106843137 815479212 815479214 877859742 877859832 186855384 186855446 879100345 879100354 758197301 758197314 975285479 975285567 694873788 694873849 989817990 989818053 613174185 613174262 197377392 197377425 553…
Output: 2

Constraints:

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

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