CT35219

The Busy Hall Beneath Brimstone

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the sulphur springs of Brimstone; 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 <= 1452; 0 <= s < e <= 10^9.

Example 1:

Input: 573 86709819 86709890 197274086 197274123 299384426 299384506 963155767 963155805 365056572 365056653 213868392 213868416 953345805 953345817 971885667 971885706 763501828 763501858 494484709 494484796 450000051 450000116 763210102 763210140 142023928 142023940 202071493 202071501 73406775 73406799 884673279 884673292 978628665 978628711 836923674 836923708 947302079 947302160 813473673 813473713 46583449 46583473 890739256 890739335 103536987 103537001 577112195 577112233 445323887 445323907 632458568 632458579 814955527 814955594 853701011 853701028 193406444 193406515 593005688 593005706 240692121 240692187 762848127 762848192 691211247 691211300 346353310 346353400 684402779 684402842 317123864 317123877 838794497 838794507 783014987 783015044 445905525 445905596 282303980 282304011 28…
Output: 1

Example 2:

Input: 41 413979044 413979118 751921865 751921963 743789355 743789394 137340474 137340542 359427641 359427650 744431066 744431111 805522761 805522784 717139539 717139553 540608588 540608600 116294263 116294284 697574148 697574207 813376948 813376988 318086388 318086461 143498789 143498811 220699298 220699345 121620899 121620950 307405133 307405218 740882304 740882306 724423017 724423025 681628400 681628430 440323183 440323282 363975320 363975351 604735894 604735945 299480669 299480697 450174702 450174789 562923331 562923358 459378116 459378176 207884131 207884225 759410056 759410148 357294451 357294532 656531101 656531113 331207379 331207407 299777872 299777957 16999497 16999547 829849176 829849200 894902282 894902346 608178862 608178892 732431881 732431926 397532604 397532688 961266640 961266688…
Output: 1

Example 3:

Input: 822 900507358 900507374 137906027 137906099 298870206 298870273 848293310 848293329 784813293 784813308 154924444 154924534 713738473 713738529 745927092 745927110 484758299 484758395 218329870 218329873 659489138 659489157 366540087 366540136 400504888 400504961 642221796 642221871 654357556 654357581 950484370 950484447 594491937 594491953 335370953 335371000 6677213 6677273 111078411 111078439 163645457 163645516 241654653 241654654 862850944 862850960 508134524 508134584 135679667 135679727 751956021 751956069 822066123 822066182 771385620 771385715 810625343 810625375 801100716 801100757 191884523 191884610 772341838 772341863 255268564 255268634 344660335 344660432 317587388 317587445 3588078 3588084 691023149 691023198 607896641 607896642 666325821 666325888 458074240 458074250 2140…
Output: 1

Constraints:

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

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