CT42823

The Busy Hall at Stonehallow

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The measurer Kavi has been asked to inspect the delivered goods. On the desk lies a long table of segments readings. 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 <= 1924; 0 <= s < e <= 10^9.

Example 1:

Input: 1681 925513109 925513139 404385521 404385588 919648516 919648539 463039146 463039167 64604793 64604835 706063564 706063628 791424958 791425044 56475136 56475211 468878427 468878502 318043807 318043894 672932533 672932556 677412242 677412325 505608470 505608545 145173990 145174067 520862716 520862718 563100457 563100493 582350335 582350426 939131528 939131560 3965843 3965881 439337072 439337124 71774743 71774769 578387622 578387681 380921294 380921368 84505297 84505349 516782476 516782556 366684002 366684025 905177501 905177575 17633612 17633693 800394546 800394571 313995327 313995353 67018813 67018850 560381079 560381157 565645711 565645753 458923427 458923442 556914607 556914707 230225625 230225667 281857157 281857201 325159881 325159977 454774470 454774565 216406959 216407002 633064228 6…
Output: 1

Example 2:

Input: 1366 135339822 135339867 355180183 355180261 948319919 948319997 200951094 200951103 575675016 575675114 156856198 156856210 184298160 184298163 792309746 792309824 694554205 694554302 764438092 764438094 88662739 88662774 565220700 565220774 31260122 31260129 313331610 313331651 14665647 14665697 311026245 311026344 255211528 255211549 354150659 354150703 88911187 88911249 446739955 446740037 248081894 248081974 255829169 255829220 926254129 926254132 923987317 923987364 852232075 852232136 532017393 532017439 946789007 946789091 253893292 253893357 899583769 899583775 294639545 294639602 214602089 214602165 398251349 398251411 221431394 221431408 865651128 865651171 331014272 331014301 130073108 130073188 788630443 788630451 992023779 992023878 887063688 887063760 517210754 517210818 652…
Output: 1

Example 3:

Input: 1653 219466881 219466981 386693938 386694038 948707283 948707353 848305946 848306039 107721935 107721978 657798508 657798561 683197594 683197678 571453307 571453358 765077498 765077502 209178394 209178395 57548336 57548357 464449214 464449241 803393495 803393516 772790286 772790332 735890543 735890597 872131285 872131292 416053002 416053050 584297702 584297802 533399485 533399510 937908020 937908056 744346441 744346470 851869682 851869684 645404222 645404256 45226998 45227067 29087280 29087362 915886022 915886119 891500998 891501009 196776091 196776178 880483087 880483186 321948891 321948984 947371482 947371556 591845025 591845039 836030904 836030923 205849139 205849188 260081545 260081561 435225554 435225578 182632676 182632736 72768273 72768291 424520450 424520481 902019605 902019644 571…
Output: 1

Constraints:

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

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