CT39229

Last windows of Xara

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Xara the clerk watches over the caldera rim of Firewatch's stores of windows. A careful computation stands between order and chaos. 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 <= 1275; 0 <= s < e <= 10^9.

Example 1:

Input: 364 163242962 163243017 549923080 549923091 706484821 706484847 102168640 102168717 48675117 48675173 655081816 655081849 932720720 932720805 212857618 212857621 343021004 343021010 244823395 244823486 96052620 96052659 239435418 239435513 956916315 956916333 415605952 415606009 84748523 84748603 940086977 940087010 200473876 200473961 403342427 403342500 935910365 935910411 678391765 678391807 972145438 972145487 564599216 564599288 345433493 345433535 587781396 587781435 936508105 936508202 520957675 520957685 208507882 208507901 23844530 23844549 363750339 363750412 442099575 442099649 777363436 777363492 737940907 737940981 230628191 230628217 45958131 45958214 341896297 341896335 593352044 593352142 611869722 611869733 817934976 817935051 965543341 965543342 910793035 910793038 404593…
Output: 1

Example 2:

Input: 250 250665272 250665322 960560538 960560634 968946855 968946896 785898238 785898258 243512588 243512618 23266482 23266491 526345256 526345262 237095804 237095894 713661864 713661923 543321622 543321640 636630531 636630574 160320751 160320804 591812519 591812590 392411741 392411811 771382805 771382810 959280187 959280208 346387947 346388043 44777349 44777409 206603686 206603766 815787226 815787304 172915221 172915264 80257934 80257951 230921190 230921211 516795419 516795465 536632034 536632110 976639957 976639969 776517719 776517792 399601394 399601411 826588850 826588910 809434842 809434915 957729070 957729113 249188282 249188329 646689231 646689317 214117250 214117346 425472110 425472181 920839540 920839556 909590068 909590123 423217870 423217873 340659235 340659323 988867108 988867194 77…
Output: 1

Example 3:

Input: 22 261224261 261224294 6425632 6425731 899179810 899179860 189263945 189264029 420236408 420236441 170536690 170536744 889314484 889314533 165667767 165667793 996198133 996198222 753259335 753259341 427338867 427338960 13147426 13147511 188711293 188711386 772134966 772135018 481721554 481721564 604685484 604685581 921267870 921267959 824104832 824104883 541195730 541195821 956363511 956363527 817000384 817000394 343804913 343804950
Output: 1

Constraints:

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

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