CT36769

Baker's panels Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Baker inherited the studio at the heron rookery of Longlegs along with its curious bookkeeping system for panels. Time to make sense of it. 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 <= 1477; 0 <= s < e <= 10^9.

Example 1:

Input: 468 279617944 279618017 247810172 247810244 201936084 201936180 815206255 815206286 405417743 405417813 457105258 457105269 490371384 490371419 823231450 823231518 934695970 934696060 89551592 89551672 286244480 286244572 216238223 216238299 197538097 197538185 381903127 381903178 716905584 716905587 136262990 136263077 413077298 413077349 891036577 891036593 339237801 339237869 344137132 344137179 804721215 804721267 908275583 908275644 332909168 332909172 185600139 185600187 859031427 859031454 423568040 423568041 307822335 307822390 520266350 520266434 706057817 706057908 163833413 163833442 880973604 880973702 248704626 248704670 639658055 639658140 900479769 900479788 156439376 156439466 743681570 743681618 915852356 915852408 826559287 826559308 776575695 776575731 547236060 54723616…
Output: 1

Example 2:

Input: 319 65242068 65242139 114102505 114102559 423440942 423440943 970705685 970705725 577222182 577222251 40008516 40008563 414527582 414527613 641503177 641503240 829604531 829604618 848831008 848831091 732672684 732672769 828144288 828144321 819537297 819537358 134852126 134852202 87647910 87647976 199823368 199823394 126855898 126855918 824967204 824967221 668706868 668706900 708480180 708480248 925006025 925006075 674813171 674813217 150630742 150630831 345006904 345006921 308112511 308112530 705036604 705036654 476507876 476507879 809367344 809367430 799694926 799695003 727196687 727196702 112093784 112093816 617645941 617646023 262497352 262497394 3821142 3821173 809200142 809200208 481465753 481465793 144225646 144225657 375068031 375068067 908534314 908534340 317122070 317122075 845513…
Output: 1

Example 3:

Input: 956 169446014 169446043 410632753 410632829 363019783 363019851 989871033 989871099 470780274 470780369 144369335 144369386 179218837 179218906 846304559 846304571 822077207 822077274 436228399 436228464 766299867 766299932 601822936 601822990 738051882 738051940 688263692 688263791 275681267 275681326 499819795 499819864 302311659 302311717 715218174 715218266 39165752 39165776 879148283 879148364 859675501 859675582 260115783 260115810 188615400 188615442 180143034 180143073 167897730 167897799 520644922 520644949 632129339 632129379 166288833 166288882 853777570 853777602 943275238 943275313 256039285 256039328 942639709 942639808 533974980 533974992 977664755 977664775 797086711 797086764 35237256 35237262 607351135 607351216 130748058 130748117 271690183 271690198 604372985 604373008 …
Output: 1

Constraints:

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

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