CT45743

Theron and the Timeworn ribbons

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the lantern lake of Firefly Mere; Theron weighs the day's ribbons manifests and starts the calculations. 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 <= 1596; 0 <= s < e <= 10^9.

Example 1:

Input: 755 336493685 336493691 342339323 342339360 422252128 422252171 514459421 514459489 484045837 484045932 546579933 546580013 787461445 787461523 975705295 975705309 135509071 135509122 50164946 50164981 870795579 870795589 626891043 626891108 455011678 455011726 658297857 658297919 139881088 139881129 391267710 391267741 480571779 480571822 837538370 837538426 314256976 314257028 926615414 926615502 484029941 484029984 914539848 914539926 912037280 912037331 162835584 162835655 596276378 596276415 830927334 830927392 569991864 569991903 319769888 319769919 42333107 42333147 18775543 18775575 751434697 751434716 465389409 465389507 621600284 621600318 968855540 968855593 123294328 123294384 463465884 463465926 221091218 221091269 457112540 457112630 873385363 873385392 469724283 469724288 26…
Output: 1

Example 2:

Input: 176 570048281 570048338 748171494 748171524 593953235 593953304 728120336 728120396 714593669 714593733 764378148 764378245 56126818 56126828 171459698 171459731 224880775 224880867 361091273 361091306 86198405 86198418 409325178 409325216 972615823 972615873 559313814 559313825 991382904 991382984 790411707 790411731 888013289 888013346 544635831 544635839 438262356 438262383 143500566 143500631 61026714 61026801 75509102 75509181 630443811 630443866 197673256 197673338 526142947 526143004 716441400 716441498 3713540 3713634 663835416 663835446 829201141 829201190 274945955 274946050 837235000 837235060 595436159 595436165 418459855 418459863 953534487 953534551 197418133 197418182 344131498 344131551 794748772 794748834 180858118 180858155 65680314 65680319 547277850 547277896 643432447 …
Output: 1

Example 3:

Input: 609 328221773 328221800 391266408 391266499 181963447 181963519 971310493 971310501 783124498 783124575 825538961 825538994 757247415 757247418 830924327 830924355 469991269 469991311 117460583 117460653 501343399 501343466 965197663 965197671 110708988 110709007 233791616 233791643 642944258 642944273 788867723 788867747 549957032 549957094 862274842 862274910 64373926 64373973 769420194 769420217 11371441 11371533 997804726 997804816 418446173 418446177 914249448 914249529 107047296 107047371 85985973 85985980 815520920 815521013 385496857 385496953 525024430 525024486 354676354 354676381 532980785 532980851 147450224 147450290 540391009 540391031 491901243 491901324 547054368 547054412 753334791 753334848 836244084 836244129 996202634 996202715 790711211 790711271 734716120 734716127 72…
Output: 1

Constraints:

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

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