CT37679

Baron and the Smoky segments

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the quartz ridge of Glimmerfell pays by the answer, and Baron intends to earn it. First: the full register of segments. 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 <= 1372; 0 <= s < e <= 10^9.

Example 1:

Input: 213 654362081 654362097 125801986 125802084 625031027 625031084 193971626 193971641 101139280 101139372 856787352 856787364 784932487 784932494 940141446 940141543 692894772 692894827 417092302 417092305 101794985 101794988 308835110 308835142 189817769 189817793 474946271 474946283 475537446 475537526 598445355 598445379 815661916 815661949 595403864 595403934 789764132 789764160 821938685 821938773 90734444 90734527 505330383 505330395 413295489 413295491 405151060 405151110 581055430 581055465 356822359 356822408 853832504 853832556 797080686 797080739 340074573 340074634 774806069 774806169 186224211 186224276 107820630 107820691 645657119 645657207 853461011 853461020 66771987 66771991 554224175 554224233 46637778 46637813 238762480 238762482 268940846 268940849 310599297 310599307 76…
Output: 1

Example 2:

Input: 424 20576753 20576807 862555701 862555749 905007024 905007103 608431917 608432005 476139767 476139848 164292548 164292564 21237016 21237068 674997394 674997482 541421973 541422005 715169247 715169259 179735043 179735129 166103045 166103132 456940797 456940800 346491624 346491650 252558532 252558550 776023003 776023040 357560489 357560532 365451528 365451598 940140443 940140524 801766219 801766261 278867180 278867203 196925048 196925125 809345465 809345554 35405234 35405294 686404913 686404951 978358155 978358178 784076300 784076396 412100158 412100171 903287629 903287709 34267351 34267422 61013708 61013781 920261248 920261321 900624347 900624397 478595414 478595444 223562994 223563046 489097925 489098022 490392082 490392112 616634721 616634793 478470861 478470896 422719175 422719185 344963…
Output: 1

Example 3:

Input: 812 498418886 498418930 466297713 466297734 883579123 883579214 87303656 87303751 666384525 666384608 597172888 597172901 187157959 187158047 690931301 690931325 621934614 621934706 253643000 253643060 662690263 662690354 947570972 947570991 672329369 672329375 377332538 377332604 872235097 872235109 104980004 104980018 903888212 903888237 23955178 23955249 511852422 511852505 489788554 489788635 269380540 269380616 843330549 843330582 508957778 508957811 825921422 825921450 262915792 262915889 389093066 389093075 966873876 966873892 551143857 551143945 546445508 546445520 132720151 132720242 519473195 519473253 545138355 545138409 894092412 894092490 983631348 983631395 251412180 251412190 583152604 583152659 498061760 498061801 407774428 407774473 590480239 590480255 75304651 75304671 92…
Output: 1

Constraints:

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

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