CT43503

Dora Counts the panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the eel marshes of Slitherwick, Dora the accountant keeps careful count of the panels. rebuild the damaged itinerary, every figure matters. 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 <= 2284; 0 <= s < e <= 10^9.

Example 1:

Input: 1689 359054469 359054568 743466649 743466671 41994090 41994186 742650310 742650330 197055733 197055822 463900861 463900886 663013066 663013087 2576458 2576503 37725752 37725767 907546876 907546938 46370946 46370998 893406694 893406730 568700564 568700597 942499150 942499224 682756210 682756288 272532535 272532562 196395852 196395874 359533966 359534056 650613054 650613059 400168548 400168643 740216990 740217084 331304215 331304227 677822644 677822721 922712972 922713040 436303699 436303786 42005803 42005813 790058265 790058329 408630635 408630708 288087700 288087784 227953341 227953438 396718891 396718966 124244781 124244881 886640388 886640453 127350604 127350692 529312189 529312289 8044067 8044162 858413353 858413404 928256456 928256509 342325559 342325588 92536948 92537006 983133243 983…
Output: 1

Example 2:

Input: 862 3199904 3199952 319080600 319080661 209323730 209323744 942145470 942145518 414497812 414497838 937747329 937747342 908293274 908293279 307025748 307025836 390353353 390353384 847777085 847777175 828632842 828632891 70288656 70288732 335526215 335526258 984338592 984338653 818268695 818268704 766707592 766707650 877009772 877009814 213728361 213728427 320101886 320101932 47286432 47286516 730040779 730040844 790504261 790504324 144596477 144596563 799289814 799289902 334382037 334382088 336036760 336036846 751929813 751929860 809693673 809693773 467662494 467662538 191593337 191593419 236162926 236162974 724499849 724499855 53455274 53455346 914447082 914447111 456811323 456811363 926979663 926979680 813126997 813127006 268689805 268689837 875097775 875097833 649608662 649608760 762050…
Output: 1

Example 3:

Input: 1672 182849428 182849453 937329241 937329307 460248885 460248930 437218786 437218822 330298658 330298748 156801767 156801863 223673656 223673730 34616494 34616537 686684767 686684800 604760877 604760916 172123318 172123379 438511230 438511244 488283650 488283716 306637003 306637071 689472333 689472376 464465864 464465933 619540083 619540164 452547891 452547909 94568846 94568911 814193484 814193485 93388557 93388614 560541833 560541886 359320068 359320147 621732911 621732952 918827612 918827682 730174808 730174809 351762223 351762262 457531 457555 82498972 82499004 469161664 469161693 29020528 29020579 849185862 849185912 850525460 850525560 294665819 294665822 539202743 539202821 874408036 874408058 580196035 580196096 648338285 648338361 961148614 961148660 938292510 938292566 864950379 8…
Output: 1

Constraints:

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

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