CT41511

The Busy Hall of the Obsidian panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

At the ribbon falls of Cascade Vale, Seth records each panels in a worn leather ledger. The guild wants answers, not guesses. 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 <= 1048; 0 <= s < e <= 10^9.

Example 1:

Input: 572 364712125 364712192 353923578 353923591 10837398 10837435 306526644 306526700 848867706 848867714 137958166 137958181 547026985 547026989 481086222 481086260 21598635 21598698 156219660 156219758 687018427 687018493 974275148 974275166 281472065 281472086 75852573 75852655 187193615 187193657 141711338 141711409 912553469 912553552 597009303 597009351 187411936 187411941 176779168 176779175 953985321 953985412 555140349 555140403 321076581 321076611 238173905 238173985 296118025 296118039 157890914 157890980 579043661 579043732 196472684 196472745 956768495 956768514 789023593 789023682 8939525 8939547 251642601 251642631 938141996 938141998 216558937 216558976 149201402 149201488 201146085 201146124 85233012 85233110 80132479 80132544 641276413 641276498 817383422 817383503 613104003 …
Output: 1

Example 2:

Input: 914 952880240 952880311 196048779 196048862 887869742 887869758 570304707 570304769 759487008 759487063 847990758 847990827 910278 910365 56714388 56714476 785853197 785853286 193418399 193418413 298861826 298861836 73379646 73379719 619915638 619915693 118767021 118767039 533108103 533108184 25991393 25991401 616738347 616738394 907023577 907023624 870058429 870058526 873554619 873554683 678199049 678199130 845311424 845311430 934132570 934132612 687940785 687940865 221782031 221782118 908711357 908711359 794378733 794378763 768736157 768736192 698121387 698121472 762154753 762154780 80342480 80342574 576142925 576142998 44639816 44639840 144971408 144971427 685068465 685068540 464415517 464415527 985457168 985457254 738064771 738064833 172646417 172646515 741398976 741399032 764094177 76…
Output: 1

Example 3:

Input: 643 877952882 877952936 205860607 205860621 636713741 636713805 103955877 103955889 55194499 55194544 19536504 19536576 547059373 547059440 755854754 755854840 80442186 80442205 281499991 281500089 86279786 86279866 666456242 666456297 16707063 16707067 894195977 894196057 633681897 633681997 133220107 133220120 725794591 725794685 740033877 740033956 525745823 525745862 8453641 8453730 514327576 514327649 195640644 195640661 32667140 32667143 509006495 509006543 290948931 290949011 744710597 744710690 816163094 816163168 48211200 48211218 706665821 706665879 829880951 829881028 801613973 801613979 728372255 728372271 14782090 14782129 442033605 442033667 297164367 297164392 677350993 677351069 122907060 122907074 32174443 32174540 614916361 614916424 954799790 954799861 733572142 73357218…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Busy Hall of the Obsidian panels - MEDIUM Coding Problem | CodeTikki