CT31381

The Busy Hall at Brasshaven

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the old quarter of Brasshaven; Cartwright 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 <= 1526; 0 <= s < e <= 10^9.

Example 1:

Input: 1216 580817414 580817429 850474877 850474885 487620616 487620676 72492305 72492355 726442337 726442347 356969883 356969887 702761224 702761239 977368128 977368220 695685204 695685298 462625844 462625915 593255850 593255923 124456837 124456889 989966307 989966360 980152003 980152091 443937314 443937413 412029007 412029025 987465081 987465124 265710243 265710331 642649887 642649924 120058267 120058268 630325152 630325189 382998672 382998684 395616904 395617004 725963927 725963996 623647729 623647818 912246220 912246313 559093825 559093907 287579698 287579725 194313390 194313468 294126081 294126102 896293842 896293922 258981283 258981341 55566624 55566716 907664101 907664120 300174619 300174697 26067377 26067475 655102673 655102699 921476577 921476613 702911229 702911261 877882974 877883025 7…
Output: 1

Example 2:

Input: 732 340808833 340808928 655144465 655144537 406984628 406984648 866529512 866529598 282224070 282224130 564894284 564894336 494077103 494077153 524256657 524256721 251440236 251440282 711900867 711900921 382074418 382074452 583736653 583736746 460748937 460748984 972442925 972442964 482461171 482461225 296748289 296748327 364700771 364700787 549146124 549146131 304372346 304372402 639877125 639877212 581094098 581094198 13937101 13937164 864289913 864289972 96893221 96893308 644206113 644206128 951694745 951694778 770454918 770454995 105255903 105255968 756123470 756123559 75834612 75834709 521051664 521051678 306207785 306207843 592792333 592792342 612057028 612057050 331467935 331468001 906597703 906597756 710146912 710146946 864113968 864114008 206602628 206602658 25345229 25345310 3047…
Output: 1

Example 3:

Input: 1520 105791798 105791834 155729549 155729631 619760207 619760280 575713426 575713437 713016900 713016963 167237193 167237219 315427372 315427465 785378281 785378371 722938758 722938827 209117241 209117305 543532434 543532489 230928184 230928190 349929263 349929360 124301216 124301277 907702330 907702390 946352454 946352474 986112339 986112362 714456242 714456323 562770331 562770395 117984208 117984213 240361623 240361698 664912680 664912715 113965873 113965875 532056809 532056811 130700696 130700747 243270987 243271003 360330104 360330107 145922185 145922247 170918011 170918043 532144166 532144251 383759124 383759189 528464101 528464104 621688130 621688181 713471445 713471456 339468295 339468331 803690070 803690119 732416157 732416170 984246172 984246261 694842810 694842873 301398697 30139…
Output: 1

Constraints:

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

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