CT43851

Mira's Busy Hall Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the lotus ponds of Tranquil Basin close for winter, Mira must finish the scrolls 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 <= 1813; 0 <= s < e <= 10^9.

Example 1:

Input: 1185 884832967 884833060 387684575 387684669 56407236 56407305 187585167 187585252 600601200 600601298 528331769 528331793 798451935 798452013 104030168 104030205 124469674 124469685 556974417 556974459 163811923 163811954 515809463 515809538 402087637 402087687 892066175 892066217 62362870 62362874 286816063 286816087 448777696 448777795 641468460 641468558 639042588 639042658 170925440 170925451 298012889 298012940 681344978 681344988 251991450 251991526 293429477 293429503 335161228 335161240 672286860 672286924 750245707 750245777 147236592 147236665 314830904 314830976 251332890 251332989 704882662 704882761 367776853 367776926 868801186 868801223 896796798 896796823 285729919 285729927 829867154 829867166 618854824 618854883 908637642 908637667 829766743 829766791 902936334 902936380…
Output: 1

Example 2:

Input: 46 279973849 279973890 217112957 217113009 583152420 583152508 297024746 297024781 58799443 58799484 325861228 325861247 300408893 300408972 773848005 773848006 90158729 90158785 397343022 397343074 585330729 585330763 149472715 149472721 589970814 589970818 799016624 799016723 724064064 724064100 815572335 815572366 23919807 23919862 553133065 553133075 593470946 593470975 78748263 78748272 678048605 678048613 809647106 809647131 399156617 399156703 852986544 852986582 434890112 434890116 106012539 106012604 168361833 168361885 166233628 166233695 951153018 951153118 55916826 55916884 225785304 225785399 673479436 673479496 178357772 178357855 432515741 432515804 914799500 914799568 825541857 825541874 816305098 816305152 926181228 926181282 488223192 488223203 469555766 469555815 6155131…
Output: 1

Example 3:

Input: 998 40503491 40503505 487639116 487639189 656276018 656276102 268888430 268888519 70591064 70591142 47590141 47590202 728904274 728904300 934456988 934456989 275425921 275425978 801475648 801475673 733898363 733898402 347800518 347800610 684082506 684082566 736820597 736820603 954819108 954819192 227680274 227680338 333922219 333922242 80680566 80680601 416560456 416560514 842593788 842593882 963365364 963365375 685548024 685548043 296129275 296129351 851932637 851932685 356721099 356721136 738975789 738975845 948975856 948975947 674510216 674510299 161432762 161432839 345074214 345074305 996466265 996466314 897008006 897008062 525136913 525136938 150844646 150844653 500298390 500298487 694105443 694105529 402457626 402457637 675675175 675675211 513665912 513666003 66595447 66595478 738332…
Output: 1

Constraints:

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

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