CT32171

Gautam's Starlit ribbons

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The council of the silver mines of Lodebarrow pays by the answer, and Gautam intends to earn it. First: the full register of ribbons. 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 <= 1165; 0 <= s < e <= 10^9.

Example 1:

Input: 978 351899049 351899055 342950424 342950491 637961949 637961964 263489261 263489335 436699880 436699933 970397684 970397783 68265738 68265821 548924026 548924087 42276058 42276087 545512426 545512482 926762802 926762889 527902188 527902273 840121816 840121875 912488258 912488281 809828053 809828072 530305820 530305833 203337783 203337785 128171138 128171165 190526004 190526063 639553025 639553108 297125259 297125267 805821724 805821807 574828641 574828650 375500147 375500241 483403190 483403278 261987207 261987271 653785268 653785368 561414131 561414203 601172848 601172895 186824944 186825021 674825417 674825503 803377092 803377137 198347939 198348015 998101640 998101652 324664121 324664122 515802406 515802494 925614629 925614639 393450573 393450600 314221891 314221908 464322685 464322754 …
Output: 1

Example 2:

Input: 762 845438951 845439045 472616888 472616977 433380716 433380811 448217518 448217574 887522945 887523040 241907612 241907645 698788382 698788384 661868316 661868356 389036174 389036175 654556802 654556876 856205934 856205994 156644615 156644634 883875271 883875362 379172051 379172124 116533675 116533771 199769544 199769590 813171924 813171982 757107094 757107131 385937492 385937582 4247276 4247300 324742326 324742397 799692125 799692134 318180480 318180558 930145847 930145919 271786410 271786437 9995915 9995952 441740553 441740617 997502658 997502751 734384674 734384734 338741650 338741722 326661 326663 304192388 304192398 231544258 231544329 808063160 808063249 39539836 39539898 725534007 725534044 5031440 5031488 688548514 688548521 398177490 398177517 890419343 890419417 444161086 444161…
Output: 1

Example 3:

Input: 144 967015882 967015959 846096835 846096873 405774211 405774276 696121848 696121884 148470392 148470452 195402004 195402040 652791148 652791186 149782144 149782176 520072952 520072990 669986441 669986462 857545168 857545245 985903896 985903899 151046703 151046793 569111425 569111443 816371101 816371121 930590363 930590415 356720970 356720999 532662577 532662615 493243844 493243927 721964878 721964939 81289156 81289171 505107761 505107831 904754689 904754735 590777914 590777927 647940648 647940740 730075661 730075742 73642435 73642511 387637972 387638061 944785552 944785580 448583530 448583535 3674553 3674571 461855014 461855058 773654978 773654979 492521089 492521169 773727255 773727325 264220898 264220920 347608923 347609018 60774285 60774334 659199717 659199813 768946391 768946415 993272…
Output: 1

Constraints:

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

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