CT45083

Teal scrolls Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Deep in the orchard lands of Applerun, Bishop studies rows of scrolls entries. One clean number will settle the guild's oldest argument. 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 <= 1089; 0 <= s < e <= 10^9.

Example 1:

Input: 851 518579114 518579129 206844065 206844123 486250300 486250358 113278893 113278947 556294451 556294539 827117344 827117396 868937472 868937521 880825526 880825569 799776469 799776546 774294690 774294741 97514803 97514886 215428396 215428440 315992230 315992273 991041470 991041482 730095818 730095897 93862461 93862514 62422025 62422124 575846207 575846258 761706250 761706260 278865201 278865296 948195783 948195872 300645910 300645985 420376823 420376914 449579950 449580003 947265549 947265558 246425313 246425344 981966589 981966619 247162884 247162886 911763656 911763724 528384654 528384683 937460650 937460660 691833183 691833248 481646373 481646459 739513317 739513335 153947875 153947940 813482301 813482339 797489557 797489604 162660150 162660170 375523324 375523363 711750797 711750809 95…
Output: 1

Example 2:

Input: 667 206853393 206853394 570056683 570056773 733479404 733479405 905775073 905775129 82972056 82972091 478765816 478765851 369493881 369493893 970766523 970766582 470071226 470071237 698658830 698658918 370809055 370809056 718947137 718947202 694547219 694547246 611074204 611074214 749878355 749878454 847805409 847805421 165236242 165236286 207760524 207760565 818162568 818162659 839183357 839183405 62365773 62365873 385017316 385017379 684292437 684292469 200314637 200314647 801560166 801560175 260059866 260059872 460907721 460907765 938016259 938016356 181880217 181880237 200405646 200405681 526614401 526614418 768652302 768652394 658283955 658284022 178723614 178723698 286467357 286467448 702291193 702291288 947303722 947303749 775664243 775664328 787452240 787452311 232741351 232741363 …
Output: 1

Example 3:

Input: 522 785162510 785162558 162536389 162536471 741771648 741771688 868239967 868240030 318258555 318258593 740476428 740476493 619513794 619513873 71507679 71507714 6217397 6217442 570962699 570962780 10589067 10589115 407647160 407647195 551014266 551014278 348524684 348524714 426381364 426381450 240420034 240420055 616882629 616882723 275672471 275672509 302306284 302306300 13782171 13782228 206480695 206480710 471514758 471514795 803688616 803688712 609181904 609181938 170659862 170659915 258123944 258123998 690827472 690827509 666521138 666521181 813056643 813056704 943326954 943327042 536137293 536137309 28679930 28679989 702192654 702192732 694244431 694244469 913914808 913914898 884433055 884433100 90640178 90640203 525640070 525640124 237451948 237451955 150256925 150256980 271305966 …
Output: 1

Constraints:

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

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