CT56942

Solar panels Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Caravans arrive at the fox den of Rustwood with crates of panels, and Zephyr the reckoner must account for every last one. 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 <= 2081; 0 <= s < e <= 10^9.

Example 1:

Input: 1938 666528163 666528185 723915057 723915117 12929130 12929187 861863128 861863186 951475096 951475152 570435251 570435286 777471893 777471957 100278079 100278115 107993428 107993475 49888074 49888161 976744302 976744331 705423844 705423854 744961834 744961901 547975441 547975533 534196223 534196296 175756444 175756507 640365693 640365728 599103558 599103591 579458855 579458918 712399208 712399248 193860445 193860473 438055753 438055844 51860201 51860235 680723094 680723133 943425880 943425967 596558205 596558223 491469174 491469251 160657374 160657410 266122209 266122222 871876949 871876978 976616518 976616526 292781012 292781089 328585368 328585439 402492264 402492326 140517128 140517186 243091909 243091932 802498139 802498145 590336162 590336183 161434649 161434745 398568946 398569041 5…
Output: 1

Example 2:

Input: 2015 296088893 296088972 673217357 673217367 309715200 309715285 107702769 107702771 512398083 512398100 856028969 856029041 643819391 643819467 138995629 138995726 895340550 895340629 270625526 270625541 432746457 432746535 891405271 891405298 598899909 598899952 564314599 564314631 681907125 681907218 352075706 352075756 171204754 171204845 669676494 669676518 434132678 434132679 902452076 902452175 677278508 677278603 572195301 572195356 954310254 954310338 76781685 76781783 438279928 438279956 516852171 516852255 398766227 398766244 31261268 31261368 103739436 103739528 895558413 895558473 49247955 49247959 571713815 571713893 836347683 836347754 133037983 133038024 979322223 979322256 15645614 15645653 901505236 901505326 759470928 759470945 108001718 108001790 199440233 199440315 338…
Output: 1

Example 3:

Input: 1276 183685322 183685344 115858007 115858022 852218282 852218324 183391382 183391467 951295549 951295566 960492412 960492481 343587839 343587880 940908446 940908489 443634606 443634703 625616173 625616200 792140499 792140558 909789598 909789662 268881299 268881398 782574681 782574741 928888371 928888463 995007587 995007658 713512218 713512240 432882118 432882157 408967750 408967763 697817134 697817205 815374948 815374962 954844543 954844552 176463560 176463610 122795266 122795358 536495925 536496006 336016747 336016776 477482354 477482448 858661947 858661955 893596262 893596311 499749851 499749931 580974300 580974321 305883410 305883489 52375670 52375762 622635490 622635550 777650056 777650072 236493432 236493476 796357990 796358088 948898467 948898560 442537756 442537810 520455769 5204558…
Output: 1

Constraints:

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

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