CT44653

The Busy Hall of Galeholm

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The surveyor Cora has been asked to tally the donation drive. On the desk lies a long table of scrolls 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 <= 2334; 0 <= s < e <= 10^9.

Example 1:

Input: 608 338410258 338410307 827174582 827174631 557726345 557726398 796492697 796492759 479099095 479099132 361949579 361949625 135849642 135849647 34754666 34754734 881889864 881889877 558737384 558737386 3627676 3627772 465321497 465321523 1392620 1392652 110494222 110494247 185233111 185233197 159513645 159513725 784971128 784971166 677239801 677239883 235129388 235129472 279535117 279535127 223300312 223300352 274780800 274780894 485510770 485510801 221483912 221483984 274419750 274419847 142325804 142325865 690701839 690701935 532377678 532377744 804250623 804250660 698354984 698355051 376823862 376823896 389536376 389536466 492368528 492368577 954426701 954426713 192390673 192390711 167182056 167182067 615040184 615040248 101412738 101412814 845700329 845700333 980261783 980261812 331421…
Output: 1

Example 2:

Input: 523 520366233 520366277 742395202 742395259 181535680 181535681 200941339 200941429 481786775 481786842 315928830 315928847 771807800 771807848 822716250 822716275 354511426 354511472 445142361 445142386 653457601 653457631 702301586 702301593 756671961 756672019 237833353 237833366 664759555 664759617 592800545 592800580 143174637 143174659 303828719 303828744 483009057 483009085 60722421 60722464 973951261 973951308 281507358 281507453 921270711 921270759 312019900 312019972 513975950 513975980 272470440 272470477 403144048 403144113 979868696 979868770 334714102 334714184 228328116 228328154 963880519 963880535 738622658 738622748 43217350 43217439 956703639 956703733 211881485 211881568 718018789 718018872 61077964 61078054 624960759 624960789 9686516 9686569 161301242 161301330 142423…
Output: 1

Example 3:

Input: 1855 910494215 910494219 966600952 966600969 931912251 931912313 662303757 662303769 935138408 935138425 64240669 64240687 115604715 115604780 50541617 50541639 580830986 580831032 399601456 399601498 539967919 539967935 247411797 247411841 142337780 142337832 40277698 40277711 234506872 234506903 320784959 320784997 299931431 299931497 650790572 650790580 426439226 426439279 163212405 163212473 704071718 704071725 79332427 79332453 718553391 718553410 509811635 509811690 981530318 981530377 241482895 241482967 730240165 730240176 495419287 495419354 725677330 725677359 893866095 893866123 200230534 200230618 360660840 360660849 349948221 349948313 220678994 220679024 172459906 172459982 386218400 386218451 679920701 679920742 945802233 945802270 867264580 867264616 73010117 73010215 53332…
Output: 1

Constraints:

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

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