CT33312

The Busy Hall of Lantern Tor

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The clerk Pavel has been asked to settle the inheritance fairly. On the desk lies a long table of panels readings. 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 <= 2344; 0 <= s < e <= 10^9.

Example 1:

Input: 1715 269861443 269861525 335036473 335036535 335926737 335926746 546360170 546360223 22301398 22301422 319269679 319269745 291686233 291686255 697064760 697064810 114150454 114150520 845661863 845661918 169712361 169712379 977788642 977788671 935491475 935491520 696865845 696865931 503140057 503140080 741888312 741888363 349355411 349355456 153139141 153139168 884836540 884836565 181281541 181281637 382463965 382463992 94486033 94486074 192090802 192090825 99821547 99821577 681377386 681377390 138528949 138529045 954931302 954931303 194836005 194836104 47547121 47547213 576040750 576040845 473095570 473095604 790192594 790192610 684314330 684314419 10719176 10719271 346864325 346864361 791390296 791390328 769944642 769944647 760793930 760793947 389549377 389549477 289006320 289006398 52689…
Output: 1

Example 2:

Input: 846 467097986 467098023 756428538 756428562 265771601 265771686 889832906 889832933 907440414 907440426 951258779 951258812 237807105 237807189 846586862 846586919 720371493 720371564 34647732 34647757 63302682 63302718 668432024 668432080 496261036 496261038 925143233 925143324 98103285 98103333 154988251 154988339 981926876 981926902 497316091 497316167 68715359 68715455 828529167 828529206 229295848 229295931 944414247 944414345 760239327 760239339 12509014 12509066 571211096 571211184 477607017 477607079 268794528 268794538 36617693 36617745 499534361 499534428 45389963 45390031 418936335 418936421 603911724 603911813 395988838 395988913 952588254 952588255 447560584 447560621 92368288 92368289 928578999 928579028 607509672 607509715 803082569 803082596 847452135 847452216 273971692 27…
Output: 1

Example 3:

Input: 644 930108869 930108902 970637294 970637318 237737476 237737573 571658422 571658473 581528866 581528872 108305071 108305089 39771594 39771631 232283727 232283756 812665147 812665156 22608651 22608708 905735998 905736093 136719671 136719746 953009100 953009150 827392546 827392560 455824226 455824253 140511487 140511525 774511480 774511485 874184871 874184875 451382648 451382732 893626239 893626277 56557850 56557890 563819917 563820002 461825651 461825738 236488857 236488927 359910658 359910667 828910904 828911000 221122577 221122623 683097512 683097558 670861702 670861770 333515078 333515138 590964579 590964584 78182459 78182521 602488762 602488843 237240817 237240844 832867090 832867106 601392533 601392632 366937371 366937404 473879516 473879550 794294525 794294619 515085987 515086046 5443…
Output: 1

Constraints:

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

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