CT32440

Crystal ribbons Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Wren inherited the depot at the cork grove of Barkhaven along with its curious bookkeeping system for ribbons. 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 <= 1784; 0 <= s < e <= 10^9.

Example 1:

Input: 1277 775888804 775888890 536389650 536389737 525658566 525658631 911224329 911224345 760945302 760945328 565830906 565830963 523607511 523607593 455235863 455235942 956425637 956425645 420140976 420141031 221014352 221014354 772008055 772008140 622131845 622131861 667987421 667987467 997101362 997101401 55334775 55334874 691229536 691229575 645087302 645087364 130936499 130936537 561706788 561706867 538801513 538801533 147907927 147908009 473642952 473643024 622780335 622780367 908553898 908553964 993806844 993806891 12810937 12811035 142982104 142982183 39205345 39205409 384823045 384823081 80321564 80321577 338273277 338273315 845916297 845916326 74805139 74805220 572683979 572684079 44287939 44287954 488210568 488210634 866199718 866199761 567594059 567594116 57572573 57572666 147800524…
Output: 1

Example 2:

Input: 1253 340989626 340989678 699935144 699935233 103651977 103652010 839989828 839989895 612954975 612954991 437678864 437678872 807535392 807535438 965930434 965930493 206023973 206023994 874384910 874384946 677550590 677550601 486641383 486641470 1445369 1445431 165355131 165355230 724405245 724405280 438000157 438000204 499356838 499356924 933856645 933856661 149937786 149937860 185408386 185408421 771243286 771243315 145721882 145721940 782169797 782169866 218794315 218794322 46733683 46733763 920878072 920878106 776646312 776646362 543790457 543790491 915157533 915157559 177824863 177824875 772799479 772799515 261535441 261535442 214958243 214958253 275132293 275132375 545810142 545810170 625569585 625569595 900900933 900900976 668354260 668354356 729670912 729670949 793285820 793285826 2…
Output: 1

Example 3:

Input: 471 945359665 945359765 559084925 559085019 274740325 274740424 671195971 671196037 52437946 52438018 837901003 837901041 32816000 32816042 11573745 11573830 430250869 430250911 902833534 902833601 962578315 962578398 785036542 785036546 430616 430630 757685754 757685800 344537911 344537996 87905669 87905769 506881844 506881870 29681606 29681609 646113759 646113774 785441241 785441247 69992248 69992270 60522104 60522191 684282053 684282064 198513596 198513656 554263865 554263877 670442767 670442813 464591204 464591251 271898103 271898175 314742566 314742594 874181948 874182008 870652247 870652312 26449283 26449291 784665447 784665516 903342156 903342163 395917458 395917492 463388266 463388312 767829297 767829311 853593615 853593656 59904939 59905030 274657545 274657547 874922925 874923020 …
Output: 1

Constraints:

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

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