CT30703

The Jasper Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Tanya inherited the stall at the marble forum of Argentium 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 <= 1885; 0 <= s < e <= 10^9.

Example 1:

Input: 1824 774673680 774673727 825238977 825239026 861456459 861456473 100633077 100633087 569313077 569313171 581243354 581243357 59339569 59339613 625194448 625194459 655673737 655673776 393728964 393729023 20040819 20040887 390906004 390906102 289558884 289558912 341337347 341337367 410530034 410530091 728514674 728514768 880163723 880163810 796847530 796847593 776802071 776802140 421882386 421882460 3646561 3646631 296722183 296722241 357905766 357905831 903449439 903449501 355304587 355304661 749581263 749581286 450450758 450450774 753947969 753948027 275327296 275327324 149247809 149247895 551231588 551231602 893945377 893945436 907433138 907433218 424491581 424491608 763673041 763673042 488828698 488828777 160926610 160926692 922419190 922419270 417179091 417179147 213333759 213333814 984…
Output: 1

Example 2:

Input: 1249 590932066 590932099 28327639 28327704 885343404 885343418 183064338 183064347 352133270 352133284 454147025 454147043 373441713 373441769 182331512 182331559 902191517 902191558 630452060 630452071 714429219 714429275 513487898 513487942 326160852 326160915 483814782 483814808 479713385 479713442 380886316 380886318 335534232 335534309 331812226 331812314 374173129 374173148 73762189 73762235 466218147 466218199 836545210 836545279 738703715 738703733 533368680 533368722 629909151 629909243 515398740 515398784 719585625 719585683 321569390 321569396 200288417 200288484 351772638 351772642 843245792 843245799 408349677 408349712 360661337 360661338 279322688 279322708 810918 810965 654513031 654513065 743246003 743246071 265739771 265739825 414880350 414880400 525007039 525007116 23867…
Output: 1

Example 3:

Input: 1210 239849975 239850018 760694575 760694667 66110977 66111007 95140930 95141014 246342665 246342710 66286551 66286588 620124113 620124211 92399 92428 7778041 7778108 290347065 290347131 906476506 906476561 635350582 635350585 256025410 256025426 303440375 303440421 140599812 140599854 469514551 469514614 822453784 822453868 492553227 492553238 479979470 479979503 746218830 746218903 536979448 536979537 578555742 578555807 977261410 977261416 450383759 450383820 235456757 235456765 484213123 484213221 406502228 406502310 221460416 221460500 810475976 810476037 438858845 438858882 929191422 929191428 856823805 856823868 175296822 175296888 457765003 457765068 665732403 665732462 90910129 90910172 479783648 479783737 788960576 788960638 229088466 229088501 497654925 497654938 153569919 15356…
Output: 1

Constraints:

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

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