CT33980

Gino's Ledger of segments

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

In the ivy courts of Vineward, Gino the clerk keeps careful count of the segments. outscore the rival chapter, every figure matters. 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 <= 2309; 0 <= s < e <= 10^9.

Example 1:

Input: 2208 787081292 787081325 7829575 7829655 733058783 733058860 927463225 927463305 895546179 895546194 936220270 936220320 70897476 70897505 899190275 899190299 637731796 637731849 330819810 330819877 914287068 914287102 452950004 452950089 221490557 221490584 860082386 860082438 71763746 71763764 296460377 296460419 285368169 285368222 662765626 662765678 722735027 722735038 852128221 852128313 717876146 717876150 158993577 158993639 120764174 120764198 529166690 529166712 356137874 356137912 30216801 30216809 409508588 409508610 369984374 369984439 568481213 568481259 381832890 381832978 366786671 366786721 504945118 504945167 876390601 876390621 190749096 190749115 745395480 745395546 651910680 651910693 49533491 49533529 820016302 820016315 690307150 690307223 546677154 546677223 2606636…
Output: 1

Example 2:

Input: 175 94115173 94115272 605580217 605580239 276407881 276407911 630143240 630143269 172482637 172482666 145875798 145875881 894812652 894812669 916418041 916418130 28975657 28975666 637529178 637529254 555479048 555479079 726543157 726543198 286656975 286657022 769241838 769241870 993169872 993169955 158287154 158287160 775500043 775500067 600852468 600852517 439140242 439140243 101294922 101295015 432935842 432935862 400608911 400608915 477220628 477220661 601664956 601665033 998960630 998960730 960712864 960712940 354164164 354164224 505103102 505103161 735366712 735366787 83010383 83010475 917746993 917747043 376969223 376969312 302427798 302427809 44022342 44022362 559375002 559375049 292563918 292563931 634511098 634511150 135880641 135880659 422971480 422971544 784567882 784567894 9588…
Output: 1

Example 3:

Input: 1125 865790621 865790713 457743168 457743175 15930497 15930572 447017494 447017516 234484782 234484873 758627348 758627359 86746509 86746542 964407518 964407558 583194845 583194942 823120464 823120542 979659530 979659578 211224970 211225048 752848453 752848523 115849481 115849528 320527987 320528023 364129236 364129270 335888306 335888393 86628620 86628671 466818639 466818673 685522006 685522090 624768528 624768552 373730174 373730209 150179631 150179663 840751953 840752033 85641526 85641626 174974306 174974406 59714968 59714973 808693297 808693353 752976913 752976988 619245702 619245723 891512684 891512687 87941277 87941354 623876458 623876493 19032391 19032398 819522195 819522200 751964156 751964189 962278968 962279028 823208397 823208414 801560520 801560597 734584421 734584485 107045600…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Gino's Ledger of segments - MEDIUM Coding Problem | CodeTikki