CT45110

The Padmore Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the lily shoals of Padmore close for winter, Blythe must finish the stretches 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 <= 2076; 0 <= s < e <= 10^9.

Example 1:

Input: 1119 437969372 437969413 165368478 165368501 713075142 713075230 457060167 457060174 311267033 311267065 744727671 744727689 980083699 980083769 911889882 911889935 16021517 16021525 311486914 311487011 936833010 936833103 394105260 394105270 773706354 773706369 924633211 924633226 483295949 483296032 210342693 210342746 359612480 359612535 25892540 25892577 191745695 191745752 880767645 880767651 387542467 387542521 947752713 947752797 267074959 267075027 820274145 820274191 642786168 642786239 729201809 729201810 561414723 561414793 799375629 799375721 558991846 558991873 439041994 439042026 616906645 616906685 789836702 789836757 481004131 481004231 689377257 689377334 534082963 534083013 537247780 537247811 427563891 427563917 606660692 606660780 76059625 76059723 145369281 145369331 8…
Output: 1

Example 2:

Input: 2018 550625088 550625176 749185680 749185758 242743955 242743998 692566843 692566900 299024849 299024930 510075306 510075360 798571313 798571386 712681985 712682018 527293443 527293537 131446422 131446435 969182600 969182651 532770477 532770510 193901730 193901816 846155014 846155038 870741378 870741400 272814575 272814663 380939019 380939038 574260200 574260230 564394376 564394446 333669621 333669655 365758874 365758909 823315966 823316058 421594815 421594868 542431461 542431532 302181224 302181312 231224518 231224533 839114737 839114750 506291286 506291322 51315657 51315730 101963822 101963862 446878171 446878259 981454805 981454882 228272406 228272438 751122507 751122565 636823722 636823726 861899659 861899727 985577876 985577926 595904798 595904886 230285772 230285863 509108061 5091081…
Output: 1

Example 3:

Input: 1050 590304659 590304718 23413138 23413176 464465119 464465191 110167124 110167138 539601397 539601402 642415473 642415554 892261105 892261198 630913183 630913256 612494853 612494886 677165801 677165817 467713162 467713256 65938508 65938527 836168519 836168607 20505009 20505098 676927755 676927764 647989952 647989977 70085653 70085681 405605652 405605731 572867746 572867837 615943321 615943346 232087004 232087081 956685308 956685309 100921191 100921243 876522244 876522261 386343401 386343500 660455668 660455751 306231452 306231523 457192572 457192623 903617288 903617385 560075898 560075909 144144134 144144168 246332169 246332260 964989211 964989242 838575160 838575186 9026326 9026418 471147553 471147648 411136940 411136998 930567759 930567830 484608021 484608058 559987021 559987050 6204815…
Output: 1

Constraints:

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

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