CT54431

Pearl ribbons Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The log keeper Galen has been asked to inspect the delivered goods. On the desk lies a long table of ribbons readings. 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 <= 2524; 0 <= s < e <= 10^9.

Example 1:

Input: 408 102475186 102475196 125859770 125859792 347642164 347642243 87468199 87468244 61951310 61951386 82970411 82970498 235841277 235841363 412470966 412470977 665582073 665582123 252820247 252820317 527829177 527829277 870860107 870860120 654776010 654776041 429855025 429855041 23214914 23214994 122633229 122633286 667379289 667379384 102112936 102113034 662061723 662061811 956230869 956230967 26125818 26125825 752073597 752073636 363926457 363926533 539134822 539134885 972733489 972733553 490942416 490942419 487988492 487988530 697895778 697895833 258039216 258039235 580252392 580252460 754444325 754444424 495231112 495231124 578094601 578094643 677322094 677322181 636546410 636546487 295626464 295626499 219424557 219424611 783542226 783542272 227364275 227364302 296821765 296821848 941038…
Output: 1

Example 2:

Input: 1605 759559265 759559292 577187232 577187245 627624904 627624983 652028988 652029044 229648358 229648409 696215205 696215257 21569016 21569032 138649073 138649132 485878320 485878365 644873433 644873498 617550302 617550312 439130302 439130362 786615131 786615154 195194159 195194232 902173070 902173166 570923950 570924024 381604994 381605020 3040473 3040503 293022431 293022447 864764160 864764218 875919491 875919541 713238120 713238129 998903599 998903602 192976553 192976612 346630424 346630431 211291089 211291141 804542929 804542952 267955055 267955109 177881410 177881502 475391479 475391510 258143681 258143711 386958784 386958863 970529818 970529840 701521892 701521898 166121576 166121585 344357295 344357388 80874509 80874598 832627356 832627385 955565708 955565763 752528461 752528486 510…
Output: 1

Example 3:

Input: 1308 66891118 66891161 46363993 46364046 667625711 667625801 804262164 804262165 613592511 613592585 243812092 243812154 464171535 464171558 54685769 54685773 679792232 679792259 713556134 713556196 264209649 264209650 920278950 920278956 150833110 150833154 834362885 834362900 673421713 673421766 976998282 976998326 481848806 481848832 710023472 710023547 612443706 612443765 888901409 888901488 248754653 248754717 734063338 734063340 759208059 759208076 834500795 834500810 158886858 158886907 364444708 364444759 333221892 333221965 664922674 664922677 789636275 789636328 506624049 506624124 21064672 21064715 703762099 703762114 907479024 907479033 283741158 283741219 979920780 979920834 757233032 757233066 56404886 56404938 879845630 879845694 399307415 399307469 382795462 382795474 14172…
Output: 1

Constraints:

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

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