CT38269

Boris Counts the windows

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the crystal caves of Luminar; Boris weighs the day's windows manifests and starts the calculations. 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 <= 2120; 0 <= s < e <= 10^9.

Example 1:

Input: 345 789235425 789235498 600964969 600964998 347121902 347121975 614905239 614905318 873648275 873648333 882864915 882864953 823297686 823297753 996956252 996956343 717768316 717768334 809220059 809220069 117857658 117857683 177081409 177081471 821944094 821944118 691174637 691174724 4393522 4393562 8870361 8870417 617011389 617011436 961133379 961133411 851763549 851763556 40464360 40464418 195897343 195897353 181667945 181667962 993865546 993865606 752702016 752702023 918653320 918653330 952322524 952322538 160070394 160070490 423781373 423781390 607711712 607711738 391311893 391311908 108704568 108704609 272644295 272644332 152967446 152967496 314191398 314191428 729469771 729469835 956658920 956658924 21380890 21380933 840882327 840882334 278489629 278489723 491355196 491355233 74811792…
Output: 1

Example 2:

Input: 194 548220454 548220506 83712027 83712120 418553835 418553930 340250261 340250349 434634276 434634347 948399826 948399842 808578828 808578896 989158900 989158951 435777885 435777952 435522086 435522154 370373628 370373723 955077093 955077100 859728323 859728416 461362318 461362375 946347147 946347239 670566197 670566282 760281088 760281095 112500168 112500217 67179866 67179955 721593978 721594040 99259358 99259361 952594206 952594283 728919990 728919991 373485810 373485890 699853622 699853651 4948302 4948389 693704929 693704969 19979593 19979650 502600588 502600662 93991488 93991579 828080392 828080485 226053570 226053664 298908211 298908287 528433116 528433136 425540772 425540828 752382605 752382612 328322540 328322553 780907854 780907871 80098657 80098685 520149780 520149807 720946396 72…
Output: 1

Example 3:

Input: 1191 322668035 322668065 566924354 566924391 841008565 841008619 880580060 880580140 313555723 313555803 438811837 438811877 569600079 569600103 641981051 641981072 836218635 836218728 895093726 895093815 126657024 126657096 675870751 675870827 338771495 338771554 456795708 456795726 607231420 607231455 268423189 268423264 845121111 845121164 821282167 821282190 644708908 644708998 59432319 59432333 676201140 676201152 577220789 577220876 374689968 374690034 459555774 459555841 20160423 20160475 537895736 537895747 436644145 436644177 905730425 905730446 855654560 855654596 548572210 548572238 378229110 378229146 615093554 615093582 141811807 141811859 660793521 660793619 995035493 995035530 713224204 713224297 298637468 298637549 984285348 984285356 402431911 402431947 977596734 977596738…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Boris Counts the windows - MEDIUM Coding Problem | CodeTikki