CT38294

Gautam's Busy Hall Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the otter slides of Sleekwater, someone must prove the quality of the harvest. This year the task falls to Gautam, armed only with the stretches register. 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 <= 1760; 0 <= s < e <= 10^9.

Example 1:

Input: 1531 331065556 331065560 201780053 201780115 786698962 786698992 785061625 785061666 401596680 401596768 216184281 216184311 778454626 778454717 655218790 655218830 916595055 916595138 988106215 988106299 916665084 916665089 711349475 711349545 851411716 851411783 452666210 452666304 431483836 431483889 665025260 665025283 227815575 227815655 640945567 640945585 901932463 901932499 970860387 970860482 400464599 400464659 633599127 633599151 153570142 153570237 862699483 862699578 277713316 277713332 47856447 47856533 684625924 684625945 124487541 124487576 888669702 888669746 684811916 684811979 17308397 17308490 350358272 350358344 952376750 952376839 306943705 306943731 508797147 508797209 41218698 41218717 787582046 787582081 995607291 995607390 576774753 576774767 385834473 385834493 4…
Output: 2

Example 2:

Input: 441 183575270 183575300 781410660 781410726 275209784 275209867 221226763 221226862 30125020 30125054 13353808 13353896 53991044 53991097 96996386 96996462 430651333 430651402 497670270 497670298 297183416 297183427 526733407 526733420 637684832 637684850 703733364 703733396 865985691 865985774 727781896 727781929 525629272 525629352 535925276 535925319 981822517 981822547 963675821 963675853 837164225 837164302 42551856 42551858 957975484 957975511 40485196 40485228 451994591 451994676 776336046 776336054 492914151 492914220 91963748 91963762 74929073 74929124 2777371 2777409 59920876 59920893 806594789 806594851 810793080 810793171 366215759 366215778 208120672 208120728 631981708 631981763 421637893 421637927 959678217 959678300 325905052 325905109 924260749 924260795 487304329 48730439…
Output: 1

Example 3:

Input: 1285 183859805 183859810 95516579 95516622 992962169 992962230 538469776 538469858 828885232 828885312 568354222 568354268 42180636 42180645 85369817 85369883 101879928 101879974 409445159 409445190 361680928 361680953 136215583 136215675 249757080 249757144 99358635 99358722 833659751 833659775 291132902 291132973 871162501 871162595 180922159 180922234 490052412 490052508 564014855 564014946 321605956 321606015 205758268 205758354 242363761 242363769 2840896 2840993 485681389 485681477 309700900 309700917 747139230 747139268 249125367 249125467 739169735 739169768 43492729 43492786 77814577 77814647 533248834 533248927 944532122 944532219 381380166 381380225 73708238 73708320 394384662 394384706 862968897 862968948 355169669 355169687 521777191 521777215 182364059 182364097 764902022 764…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Gautam's Busy Hall Ledger - MEDIUM Coding Problem | CodeTikki