CT34068

The Stonehallow Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Dante runs the kiln at the granite steps of Stonehallow. Today the books show a list of windows, and the numbers must be worked out before sundown. 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 <= 1421; 0 <= s < e <= 10^9.

Example 1:

Input: 97 445058289 445058315 410882038 410882114 949819095 949819165 617512260 617512339 798042139 798042184 402109419 402109453 424647670 424647731 528965886 528965935 759028468 759028510 17890736 17890774 197266273 197266328 206480693 206480729 840865621 840865683 399584888 399584895 146273397 146273476 811553282 811553317 586271721 586271746 213114947 213115044 430245027 430245107 667032677 667032742 264697606 264697703 936358435 936358475 566238579 566238611 978454830 978454916 776502877 776502921 556146094 556146119 763839099 763839128 214676834 214676926 797343065 797343103 28669378 28669440 180038446 180038518 476131873 476131902 602029528 602029625 472557961 472557988 621521580 621521666 913642982 913642985 186487232 186487324 86163370 86163430 973845537 973845567 864398816 864398858 544…
Output: 1

Example 2:

Input: 1095 750269141 750269218 678334178 678334247 870442639 870442657 422503089 422503159 16020990 16021051 296444877 296444900 903413154 903413180 603727233 603727256 568619314 568619403 239153123 239153143 433726381 433726391 581703249 581703261 433730431 433730503 74320830 74320905 705078311 705078323 679062183 679062261 448805358 448805403 141089218 141089297 617825287 617825349 605387611 605387659 569311825 569311888 328289167 328289176 310630607 310630703 228770720 228770812 136516440 136516495 319142853 319142870 738699758 738699785 749474032 749474079 715885830 715885919 96718345 96718413 91350894 91350976 422388773 422388800 251686963 251687059 477939335 477939349 585871318 585871336 553580474 553580480 48312291 48312375 86432864 86432948 815969765 815969775 796866848 796866873 6554547…
Output: 1

Example 3:

Input: 618 969961685 969961768 693886195 693886269 839560104 839560181 876600132 876600219 825587342 825587368 325417030 325417090 435450288 435450330 630968886 630968905 907603469 907603550 399548775 399548797 495298917 495298934 466984410 466984500 409046904 409046952 380987091 380987106 981291052 981291152 82584998 82585083 524912373 524912389 187036806 187036890 506539806 506539874 101431851 101431881 73575764 73575766 475625845 475625897 125716910 125716989 536475659 536475672 36311091 36311172 463362454 463362495 738472234 738472291 547540641 547540723 91059669 91059763 990359151 990359215 271570547 271570636 957787724 957787777 151637937 151638029 231130541 231130633 597588355 597588394 403478724 403478808 462669446 462669507 423049415 423049473 978444923 978444976 348030595 348030663 1864…
Output: 1

Constraints:

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

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