CT41436

The Brass Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Notary runs the apothecary at the singing sands of Echo Dunes. Today the books show a list of stretches, and the numbers must be worked out before sundown. 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 <= 1783; 0 <= s < e <= 10^9.

Example 1:

Input: 1654 689836381 689836416 696180491 696180557 465317998 465318018 124611238 124611315 718966761 718966804 109557950 109558010 620855316 620855360 836659783 836659867 286274222 286274262 653257187 653257213 747402154 747402198 290290868 290290904 996318650 996318677 586335183 586335269 69906388 69906410 168128252 168128316 604768466 604768556 718959185 718959232 83873963 83873984 562265388 562265467 216509559 216509565 962982098 962982177 176323709 176323739 915452274 915452344 186035878 186035880 86187449 86187495 595925023 595925058 472299997 472300034 379753550 379753580 242795856 242795885 889977929 889977972 197662703 197662705 460272485 460272493 68581926 68581956 831667087 831667143 584227228 584227250 903725383 903725387 662391935 662391984 162464461 162464560 610829314 610829367 736…
Output: 1

Example 2:

Input: 580 759263651 759263672 694547563 694547588 327574187 327574242 980371561 980371579 973505501 973505511 474951638 474951672 508819728 508819820 783862997 783863087 339239727 339239780 238075097 238075181 800517917 800517927 142473690 142473731 7907775 7907871 275914147 275914201 888317770 888317807 545008345 545008398 373479991 373480062 325506466 325506548 476969164 476969198 456136552 456136576 575732732 575732734 314721801 314721843 328882540 328882607 156406430 156406455 744841799 744841821 355995388 355995453 378327386 378327466 871178530 871178551 520849227 520849262 667379411 667379466 245677342 245677430 307116875 307116911 464091303 464091316 756153962 756154028 464338856 464338928 413006181 413006204 200958414 200958434 713648999 713649098 510066370 510066402 788159685 788159718 …
Output: 1

Example 3:

Input: 679 157030407 157030439 941129211 941129298 42458404 42458425 952833948 952833988 121417422 121417457 368937068 368937088 4040010 4040079 832997609 832997635 181449597 181449601 678277686 678277767 185080728 185080754 199377752 199377759 451157269 451157321 466083865 466083876 391183197 391183269 455563638 455563663 360532963 360532972 423491931 423491967 650542237 650542263 503268955 503269044 293437504 293437561 161896073 161896171 486064285 486064377 319460438 319460480 682740384 682740409 11278933 11278988 855420989 855421033 526004111 526004166 86481471 86481481 986265935 986265989 814676656 814676696 609652885 609652920 552617922 552617929 162025983 162025991 480849911 480849919 233523504 233523598 50187661 50187708 772626129 772626179 812024521 812024529 784659380 784659450 22430309…
Output: 1

Constraints:

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

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