CT40902

The Stormrest Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Legend says the vault under the cliffside roost of Stormrest opens only for a perfect tally of scrolls. Brevin means to find out. 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 <= 1030; 0 <= s < e <= 10^9.

Example 1:

Input: 590 932656367 932656453 75280103 75280106 11396698 11396718 703743710 703743756 20081362 20081371 46565524 46565531 698079421 698079476 178472018 178472094 907338025 907338043 274114725 274114816 673809296 673809308 403199172 403199176 448512565 448512642 859597266 859597353 916042600 916042681 291976845 291976876 70859319 70859334 189220744 189220770 42708725 42708745 489495102 489495200 753307289 753307316 851618324 851618408 582411532 582411616 710667568 710667664 43766958 43767033 28687363 28687395 825100781 825100861 886528499 886528569 941752733 941752800 580145077 580145139 468436548 468436568 836075371 836075467 945239310 945239324 239501587 239501656 660834902 660834970 76634090 76634149 345648678 345648703 739644572 739644603 720070247 720070254 835244598 835244668 595442982 5954…
Output: 1

Example 2:

Input: 204 684198015 684198032 565278451 565278482 452330540 452330609 155208295 155208297 789191591 789191677 235003658 235003733 211860487 211860558 858417825 858417838 730152805 730152827 952654719 952654759 489487618 489487695 368676967 368677048 288270685 288270689 130047629 130047655 503885196 503885271 250652007 250652034 746122902 746122915 74491156 74491193 478374537 478374547 106315027 106315089 387276415 387276417 131082822 131082852 106240983 106240986 170492232 170492287 458860750 458860773 678055877 678055923 506328295 506328337 184711087 184711134 701676572 701676617 180851235 180851324 391676687 391676726 260062613 260062643 923097703 923097765 291650036 291650072 909958347 909958350 806414227 806414313 252229271 252229332 222236909 222236962 823995180 823995237 382217713 38221775…
Output: 1

Example 3:

Input: 990 797029196 797029241 310929689 310929722 269521568 269521648 981157453 981157481 438332590 438332647 53770950 53771023 365140517 365140609 237708215 237708269 649888552 649888639 374098257 374098310 63215428 63215432 62683599 62683675 285493646 285493690 309129909 309129921 615026702 615026731 649220934 649220984 336615069 336615167 35095616 35095646 673429436 673429458 549662866 549662948 977918153 977918174 241006142 241006229 185119461 185119544 541440823 541440840 863068139 863068155 958204170 958204253 934073720 934073789 590824391 590824423 944201420 944201426 371162455 371162476 815633956 815634022 226134170 226134195 518236863 518236927 886226736 886226821 417447879 417447965 607391695 607391754 279276216 279276278 216616811 216616829 437748500 437748600 92571863 92571900 646608…
Output: 1

Constraints:

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

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