CT43588

The Duskwood Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Finn runs the workshop at the frontier camp of Duskwood. Today the books show a list of windows, and the numbers must be worked out before sundown. 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 <= 2719; 0 <= s < e <= 10^9.

Example 1:

Input: 1332 783015179 783015219 401645831 401645908 487924542 487924634 872949467 872949552 44445433 44445457 680936518 680936604 229032905 229032980 163217924 163218022 960972199 960972267 605256692 605256776 710893868 710893922 625110885 625110937 731675645 731675697 385206743 385206783 110497567 110497617 602385805 602385899 691443483 691443547 37135517 37135603 192993816 192993890 2576687 2576781 695315513 695315575 334933173 334933199 676741764 676741803 576071325 576071337 483365405 483365447 125343260 125343307 325482445 325482451 592867575 592867580 794346772 794346864 966864349 966864401 109860847 109860891 280333469 280333492 910271024 910271098 902026720 902026785 260290473 260290570 194743835 194743847 759947513 759947589 583339698 583339712 952280917 952280948 745824042 745824058 802…
Output: 1

Example 2:

Input: 2046 312184809 312184895 637108850 637108922 823922913 823922986 337288990 337288993 240977740 240977758 709033741 709033831 281869799 281869877 132401569 132401648 560361239 560361290 422087490 422087559 973074227 973074235 546367497 546367577 812298944 812298992 165931506 165931512 225768887 225768971 478886397 478886412 530669728 530669767 285224347 285224431 60370071 60370166 642107281 642107365 757024576 757024582 349534650 349534665 189438805 189438844 603309270 603309322 829241328 829241410 207824517 207824530 695297227 695297314 920356970 920357049 360769350 360769446 18493743 18493754 321323561 321323609 876614863 876614890 901909398 901909489 856169042 856169054 672432673 672432770 736773347 736773366 887415416 887415431 356349636 356349673 132791570 132791617 417092077 417092144…
Output: 1

Example 3:

Input: 2593 257063111 257063195 209721046 209721139 99346644 99346700 610924249 610924324 753907250 753907294 917565066 917565102 313145049 313145135 976053666 976053698 73176861 73176943 298741058 298741099 276546152 276546192 858060723 858060777 2869844 2869885 280169048 280169147 42171958 42171969 680570644 680570736 557799791 557799798 449300240 449300276 369995528 369995591 17324539 17324638 576465481 576465535 428341036 428341041 662905870 662905882 381989507 381989557 682904931 682904942 253824712 253824751 512290093 512290162 532982976 532982994 183345335 183345381 534085326 534085416 585877687 585877784 742798986 742799027 410297072 410297163 159116248 159116347 440114169 440114242 143835166 143835179 134666952 134666956 725832452 725832475 824934938 824934973 117090711 117090807 9962449…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.