CT33168

Gail and the Gleaming scrolls

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

It is audit day at the anvil district of Hammerfall. Gail spreads the scrolls records across the table and picks up a sharp pencil. 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 <= 2481; 0 <= s < e <= 10^9.

Example 1:

Input: 2079 790937673 790937699 58655989 58656031 433734183 433734276 191238907 191238940 479575745 479575776 296119650 296119744 786428552 786428638 90743404 90743467 231573039 231573090 112253430 112253462 169281879 169281966 158918602 158918607 7020687 7020769 583778927 583778978 603975924 603975946 372453082 372453167 101674189 101674242 767685946 767685969 81381822 81381913 209319554 209319616 542607280 542607353 857810855 857810910 878311517 878311543 720234580 720234635 88493987 88494074 980740546 980740592 878141988 878142078 330588974 330589005 2429442 2429531 735541248 735541312 236280970 236280992 403862205 403862239 881055420 881055443 226193065 226193132 222370806 222370878 631713444 631713496 147896314 147896318 345342817 345342834 570512006 570512104 345399317 345399360 164874439 1…
Output: 1

Example 2:

Input: 2374 616496555 616496653 4409794 4409873 485602918 485602973 679048543 679048628 698216650 698216684 814186646 814186736 90315899 90315947 467488499 467488547 842141685 842141767 732489392 732489464 997355257 997355295 848694220 848694306 903874870 903874922 326077607 326077627 465526594 465526679 285338806 285338808 350682761 350682768 214087305 214087393 432556200 432556239 149735090 149735162 915830215 915830287 763691786 763691798 525808558 525808596 150484675 150484769 960438678 960438756 886762515 886762587 211640652 211640664 740888361 740888418 933684688 933684704 109963459 109963466 110739516 110739605 640359189 640359215 385537337 385537351 691154115 691154177 64674356 64674393 548572379 548572420 161027520 161027599 898418234 898418310 354634278 354634363 789703500 789703589 817…
Output: 1

Example 3:

Input: 1907 579214141 579214180 891802807 891802821 274352518 274352615 629542927 629542980 683562408 683562410 209965231 209965312 23023382 23023466 164335675 164335707 442649452 442649545 546015159 546015165 409869116 409869136 260314291 260314332 443821730 443821765 776380530 776380576 561237725 561237774 414551680 414551775 920116570 920116616 899498818 899498871 124407047 124407114 816549393 816549463 693701941 693701992 16245460 16245545 125239799 125239899 981379919 981379997 435369573 435369640 836730705 836730734 165491044 165491066 329649198 329649223 533590982 533591035 272178316 272178401 234347353 234347411 131616194 131616231 247125524 247125577 889839282 889839367 149332838 149332898 904868941 904869033 289614989 289615071 490004245 490004267 141264443 141264448 937984005 937984011…
Output: 1

Constraints:

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

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