CT38572

Darian's stretches Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the valley of Misthollow as Darian unrolls the day's manifest of stretches. The tally will decide the next shipment. 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 <= 1585; 0 <= s < e <= 10^9.

Example 1:

Input: 370 509088471 509088548 244395664 244395741 418277365 418277416 16092527 16092529 821594582 821594652 624203005 624203054 530504166 530504229 973709315 973709338 726363426 726363504 663832701 663832729 188178262 188178357 254675686 254675715 243305073 243305151 716342994 716343014 298825708 298825719 698301387 698301448 876427061 876427131 602450988 602451079 370257174 370257264 906093100 906093162 452604887 452604927 215212217 215212279 180618726 180618781 108995010 108995054 182024550 182024646 812919173 812919249 496661503 496661555 998104015 998104019 691563365 691563419 744762726 744762816 97247885 97247932 368264789 368264849 173434140 173434158 51006244 51006287 157580719 157580795 714299639 714299642 757415921 757415956 125754956 125754994 975797329 975797414 433983577 433983605 34…
Output: 1

Example 2:

Input: 1117 271895788 271895814 900482575 900482582 397168245 397168272 470750948 470750951 893051128 893051142 65847640 65847693 794877303 794877331 461727313 461727376 325390227 325390244 205338543 205338627 953402015 953402074 828917848 828917920 218878558 218878644 431760298 431760311 873651674 873651714 813074357 813074358 13055059 13055087 378683076 378683155 604936985 604937031 400506499 400506597 926244079 926244173 474116005 474116012 321182128 321182135 49268312 49268369 798946854 798946943 936962152 936962212 207665344 207665394 559050662 559050701 393146632 393146637 489440611 489440711 957959580 957959622 458638919 458639014 226152332 226152407 175877885 175877959 947850767 947850801 513003599 513003676 363224914 363224997 844541324 844541410 16768336 16768344 598571288 598571303 755…
Output: 1

Example 3:

Input: 1293 332111402 332111475 535526474 535526566 75937734 75937781 369011767 369011818 353473873 353473878 708046606 708046612 118860452 118860473 942157807 942157855 736115385 736115400 631380899 631380912 850380768 850380787 844497039 844497046 297574647 297574710 404868815 404868873 105757766 105757796 513295749 513295790 313000729 313000735 614296109 614296126 175492758 175492764 143943670 143943706 439376220 439376277 158640647 158640649 703878440 703878540 534840424 534840514 140413790 140413869 725457305 725457393 682264021 682264030 841217317 841217379 392820073 392820170 25149543 25149544 200389039 200389085 618939661 618939692 435456855 435456915 384752810 384752823 65728036 65728059 411086494 411086513 393028942 393028944 687980162 687980215 465665164 465665212 411149098 411149153 8…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Darian's stretches Reckoning - MEDIUM Coding Problem | CodeTikki