CT31764

The Umber segments of Farhan

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the clockwork quarter of Gearford close for winter, Farhan must finish the segments ledger - one figure at a time. 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 <= 1937; 0 <= s < e <= 10^9.

Example 1:

Input: 1237 396628385 396628387 981680392 981680439 322386363 322386387 350805010 350805107 170328416 170328471 206895466 206895485 623412335 623412341 269304470 269304517 567723238 567723279 460954372 460954447 609656971 609657034 38021903 38021995 196567993 196568065 402101776 402101825 502439617 502439660 313489575 313489580 2816964 2816979 420832904 420832978 586822504 586822576 26298463 26298499 937716774 937716827 394299436 394299442 132952250 132952337 352281906 352281962 14231607 14231640 685413413 685413419 94105869 94105872 478690238 478690292 730420605 730420625 536140920 536140925 947793316 947793370 839124844 839124870 941449325 941449377 283705530 283705550 27726036 27726038 117916863 117916914 344021127 344021187 24073310 24073340 270695215 270695286 764500454 764500533 682535757 6…
Output: 1

Example 2:

Input: 1644 480524861 480524931 381653889 381653972 932005026 932005043 212158364 212158386 925195730 925195804 313724647 313724705 818277804 818277811 939460830 939460880 665245790 665245835 898206578 898206634 896085180 896085268 854600883 854600956 158037194 158037208 124647651 124647685 273785113 273785130 985130584 985130614 10240378 10240415 157880606 157880621 19706833 19706907 453982279 453982356 91677420 91677483 685574904 685575001 837505154 837505175 303805815 303805847 685658097 685658168 459962068 459962080 100298016 100298113 619338446 619338546 149040818 149040820 239976504 239976515 864004558 864004578 552662481 552662565 743371 743436 713712530 713712549 15944407 15944415 927086632 927086687 415449318 415449400 24448126 24448161 981701725 981701773 898623857 898623892 240145020 2…
Output: 1

Example 3:

Input: 1375 452659631 452659659 627362927 627362929 207355422 207355455 912628801 912628820 801944399 801944424 150222971 150223004 509395291 509395332 504158132 504158175 888916165 888916250 279161434 279161487 870707532 870707564 564911107 564911159 512125198 512125231 356557367 356557401 179878400 179878482 116512364 116512451 698550491 698550586 34270692 34270721 890655815 890655904 314034163 314034216 708402443 708402536 151733785 151733821 977651875 977651955 599815783 599815843 794594711 794594714 380595416 380595488 685304936 685304943 518611423 518611451 354550550 354550621 363681107 363681115 753808983 753809079 333854989 333855065 407409631 407409657 602042895 602042976 303092020 303092036 166359308 166359408 253779241 253779315 512503100 512503163 594646071 594646110 171882364 1718823…
Output: 1

Constraints:

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

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