CT49361

The Bronze Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the lakeside town of Mirrormere pays by the answer, and Wheelwright intends to earn it. First: the full register of stretches. 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 <= 1896; 0 <= s < e <= 10^9.

Example 1:

Input: 313 312859405 312859452 889346271 889346362 872123195 872123234 666624296 666624322 563265816 563265893 26217957 26217968 696471730 696471823 377613682 377613691 733777548 733777608 501862864 501862953 397384718 397384767 951198181 951198193 436623148 436623248 633095352 633095387 780896825 780896831 936690663 936690682 149677802 149677900 565931604 565931661 942192246 942192283 553873265 553873327 291887761 291887826 908606790 908606833 715981806 715981854 592648057 592648129 568310669 568310738 373634965 373634978 638209251 638209273 947607417 947607465 80362987 80363023 58574063 58574159 767292329 767292336 892005120 892005183 961641698 961641758 788515097 788515167 936823446 936823473 620959052 620959107 7074320 7074401 59261206 59261252 842831019 842831117 762557339 762557422 10358488…
Output: 1

Example 2:

Input: 1000 844740580 844740645 393943164 393943228 778804410 778804440 914203892 914203961 520695650 520695735 943817392 943817456 437248976 437248997 205470861 205470892 799951504 799951528 24082465 24082522 975781331 975781341 13337487 13337525 682010807 682010848 802228917 802228954 841730854 841730887 21799773 21799780 549230485 549230515 924803573 924803633 105242234 105242276 430809191 430809285 137921917 137921965 842125374 842125402 485782734 485782800 501375124 501375151 115030309 115030318 269925425 269925519 572466016 572466057 113157440 113157441 396307194 396307230 436291449 436291455 284147429 284147450 513095940 513095970 756626302 756626368 720286336 720286436 84625176 84625198 720030794 720030879 60305741 60305818 268499855 268499919 132175261 132175333 942209933 942209938 24405…
Output: 1

Example 3:

Input: 1377 671088528 671088574 103073715 103073757 863173793 863173851 373381631 373381717 773550626 773550721 15353303 15353387 195030197 195030239 675899668 675899729 241128291 241128378 708108352 708108367 244861966 244861987 140839250 140839293 131991706 131991737 902913960 902914046 96315309 96315320 233190079 233190169 990036000 990036077 767993332 767993390 260658768 260658825 515856566 515856631 844442047 844442088 971415954 971415956 766606190 766606193 241045159 241045235 761214584 761214622 263647632 263647695 530061964 530062018 896427604 896427648 593307161 593307251 505487218 505487256 729512100 729512190 350377536 350377579 489601284 489601372 952822199 952822223 647284684 647284766 228657114 228657120 352747428 352747459 745998185 745998255 846939667 846939754 809850529 809850561…
Output: 1

Constraints:

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

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