CT40461

The Opal Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Indu the chronicler watches over the mountain city of Highreach's stores of panels. A careful computation stands between order and chaos. 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 <= 2754; 0 <= s < e <= 10^9.

Example 1:

Input: 91 897506507 897506513 487800352 487800353 182045201 182045292 705194560 705194566 482615689 482615780 72918283 72918374 608023607 608023646 816050872 816050873 355792679 355792730 36340747 36340823 979982293 979982347 885265585 885265642 281246847 281246918 711121383 711121431 794859267 794859292 969029204 969029251 312586833 312586877 191683760 191683804 739396542 739396568 931837211 931837246 817432600 817432658 887606316 887606395 88293297 88293299 240953928 240953964 305657119 305657209 275932472 275932495 379511190 379511235 477610443 477610468 329326142 329326163 607906947 607906996 803135117 803135165 77893548 77893574 889880716 889880795 421118538 421118574 256284039 256284074 882825377 882825468 623419492 623419540 994396071 994396119 594755576 594755581 922129198 922129240 56042…
Output: 1

Example 2:

Input: 1841 407572096 407572170 906556960 906556966 477404559 477404645 410370274 410370361 162695851 162695910 333677932 333678018 58838761 58838805 121996572 121996575 543887869 543887908 855319966 855319991 269825544 269825635 813228237 813228337 957671284 957671342 318070829 318070856 442396920 442396970 438252095 438252183 225228625 225228710 520503493 520503571 393615174 393615241 305692339 305692341 599468879 599468934 814733548 814733592 626632804 626632873 843286471 843286540 142635185 142635201 266443386 266443432 503907069 503907104 323354194 323354286 537369938 537370036 512691363 512691375 547369189 547369255 705828725 705828752 571102369 571102405 997721910 997721976 339035983 339036016 384771362 384771435 289401598 289401651 954914757 954914810 911806693 911806752 782405465 7824055…
Output: 1

Example 3:

Input: 529 785172345 785172361 91456068 91456129 432969028 432969093 419694550 419694568 900425484 900425570 343428445 343428541 731144275 731144314 760045681 760045753 467644163 467644241 8461333 8461412 212530453 212530508 962490348 962490395 994238648 994238724 354499831 354499834 572784700 572784755 794013537 794013538 467250434 467250443 369191694 369191750 677991630 677991717 656799251 656799275 556648881 556648908 486946943 486946984 503734986 503735074 735118768 735118841 584476758 584476771 949195975 949195998 169777827 169777838 277486917 277486922 745457473 745457494 70800836 70800911 99739145 99739148 646618465 646618543 472193974 472194041 758860445 758860462 286377675 286377727 533103528 533103572 163756141 163756164 673623610 673623690 205998816 205998831 684392862 684392863 233989…
Output: 1

Constraints:

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

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