CT32605

The Busy Hall Beneath Needlepoint

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the pine barrens of Needlepoint close for winter, Yusuf must finish the panels ledger - one figure at a time. 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 <= 2144; 0 <= s < e <= 10^9.

Example 1:

Input: 1000 213793182 213793261 69061592 69061623 126098954 126099044 574196596 574196653 805226964 805227048 717053124 717053154 646580931 646580938 705033708 705033716 559728417 559728496 389813272 389813282 906776122 906776167 528301696 528301794 370418169 370418171 254322165 254322215 531292684 531292709 941515700 941515793 530392997 530393013 59362639 59362642 328920967 328921030 595643282 595643324 830914386 830914434 490872050 490872066 805054529 805054575 791134561 791134605 166318418 166318425 818505608 818505697 831104964 831105041 339313316 339313380 535857225 535857247 115063763 115063825 459311861 459311867 1925325 1925330 679949308 679949328 662429403 662429405 950823383 950823433 800695863 800695870 366639015 366639057 107292288 107292384 192082186 192082261 507243241 507243316 534…
Output: 1

Example 2:

Input: 1065 571677272 571677334 489686489 489686516 171091197 171091290 44802179 44802194 366545397 366545436 421196064 421196114 365984630 365984655 927704546 927704640 886698557 886698627 212771679 212771713 633533888 633533984 999670856 999670941 801481398 801481409 883846020 883846083 219967365 219967372 637425159 637425187 197144380 197144407 189419172 189419247 847919024 847919089 690796329 690796406 630316876 630316972 767101045 767101116 161929824 161929852 696894564 696894606 909057307 909057336 74532865 74532882 932683422 932683470 904867143 904867208 100237733 100237783 630903294 630903320 687785628 687785660 173902284 173902366 279786204 279786290 857014020 857014040 380998315 380998335 726502150 726502170 356574382 356574462 886848049 886848145 608359102 608359134 453688596 453688670…
Output: 1

Example 3:

Input: 1972 922748598 922748660 931779631 931779726 148186147 148186198 599321555 599321562 145826325 145826403 388198906 388198947 958395608 958395613 819288741 819288780 301404159 301404171 221822322 221822389 393669824 393669903 23055680 23055705 87125307 87125326 149171242 149171319 153691423 153691489 681104320 681104387 437482059 437482060 403405578 403405595 449823024 449823037 118701167 118701190 627905283 627905335 411696652 411696696 653116506 653116573 773958719 773958770 80299639 80299688 196647278 196647305 535610358 535610458 428553480 428553516 502777191 502777259 171654781 171654870 923245802 923245812 642788480 642788556 605698612 605698656 293178088 293178119 228586500 228586550 187805948 187806012 788510110 788510126 704348129 704348154 931522587 931522679 114902106 114902189 3…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Busy Hall Beneath Needlepoint - MEDIUM Coding Problem | CodeTikki