CT37864

The scrolls at Slitherwick

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the eel marshes of Slitherwick pays by the answer, and Wamika intends to earn it. First: the full register of scrolls. 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 <= 2461; 0 <= s < e <= 10^9.

Example 1:

Input: 1611 392083716 392083769 572384902 572384993 673499996 673500067 469733824 469733898 21187006 21187075 746664196 746664269 514264550 514264627 66006840 66006890 293995856 293995914 810969333 810969355 297334877 297334949 77650852 77650938 764682840 764682930 435384257 435384341 266667292 266667369 41231214 41231255 154104086 154104132 781815855 781815916 448429503 448429536 984382371 984382455 957671831 957671912 561160157 561160252 390587411 390587498 590064735 590064798 738719579 738719642 935180639 935180725 717533940 717533941 401776902 401776940 136913300 136913376 601336193 601336246 592059211 592059213 41009955 41010008 978966981 978967024 275445414 275445429 658354634 658354708 424593941 424593960 232693031 232693062 19119619 19119627 202235949 202236014 800745335 800745400 5806763…
Output: 1

Example 2:

Input: 1360 705598689 705598776 549502854 549502940 790504211 790504307 919026439 919026507 75664402 75664474 887300266 887300283 771390179 771390188 620760760 620760824 856800994 856801005 688489159 688489224 76394747 76394821 669821111 669821170 861105126 861105206 626839605 626839643 496017021 496017067 87678081 87678152 436061223 436061295 591806269 591806275 914137003 914137038 414984369 414984385 793062207 793062251 342872080 342872177 268745209 268745238 30805976 30806076 113176455 113176470 700628822 700628829 535769369 535769442 6623746 6623798 209956248 209956250 420619884 420619901 983153018 983153050 106402141 106402162 33794702 33794765 210047458 210047524 914123789 914123842 755774086 755774129 411168653 411168731 958108767 958108801 238824968 238824988 990442635 990442678 84821116 …
Output: 1

Example 3:

Input: 1172 852360850 852360902 302504597 302504609 535080825 535080890 42125888 42125925 590585565 590585590 196877860 196877939 50550245 50550317 945518921 945518990 792104761 792104762 979391656 979391684 696062337 696062379 893907603 893907659 522602147 522602226 228880590 228880628 695977592 695977686 726058815 726058827 794433238 794433311 28566617 28566642 603856869 603856890 906185762 906185851 542081526 542081586 95529680 95529725 235968367 235968388 96265457 96265518 51163143 51163160 411870961 411871045 140870697 140870738 329279490 329279554 723983977 723984007 399791326 399791365 708667142 708667181 394154390 394154420 134186255 134186330 674887891 674887958 990444222 990444226 872818750 872818772 681194226 681194281 163481302 163481308 295690250 295690254 273899124 273899187 4736674…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The scrolls at Slitherwick - MEDIUM Coding Problem | CodeTikki