CT53477

The Busy Hall of the Rustic ribbons

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Anaya the valuer watches over the marble forum of Argentium's stores of ribbons. A careful computation stands between order and chaos. 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 <= 1311; 0 <= s < e <= 10^9.

Example 1:

Input: 64 382718593 382718622 317449508 317449547 274169235 274169293 961015480 961015489 383222621 383222710 952715137 952715228 647309536 647309590 499040316 499040399 487777557 487777624 975372245 975372314 40694446 40694480 179600838 179600885 413429090 413429106 548449725 548449730 452055230 452055237 462495722 462495772 228250904 228250923 121489186 121489213 921057636 921057694 173312609 173312682 977399694 977399710 778079659 778079733 731867827 731867878 353850469 353850554 362187305 362187363 890699107 890699127 272206339 272206382 687339145 687339147 158980655 158980676 959135488 959135557 783993283 783993358 645329862 645329878 807650571 807650642 197349349 197349387 141584564 141584571 601978561 601978631 197958774 197958871 599307144 599307163 607670334 607670382 396325357 396325410…
Output: 1

Example 2:

Input: 850 963419248 963419341 180479340 180479396 499575684 499575759 379618181 379618230 893762989 893763006 866757515 866757607 359083715 359083789 727735041 727735100 121945642 121945657 545549398 545549444 332296021 332296116 656758548 656758569 786739170 786739203 672017765 672017830 512576842 512576873 231725685 231725690 972089240 972089322 501536105 501536110 166673298 166673309 216937278 216937311 189206183 189206203 807383189 807383236 776290595 776290598 817928964 817928966 261910564 261910618 11377685 11377779 253990925 253990978 555723123 555723176 41055996 41056072 542519317 542519406 718786587 718786623 402833470 402833477 486322736 486322784 934434800 934434816 229487239 229487327 757430083 757430159 459183612 459183673 541064272 541064300 232103137 232103141 810694162 810694187 …
Output: 1

Example 3:

Input: 1197 547491704 547491734 94625775 94625786 874777009 874777042 706836149 706836151 717706209 717706298 723084080 723084169 286985885 286985955 93835478 93835573 497762620 497762703 307930860 307930880 98535144 98535207 77865505 77865586 327051706 327051714 451768600 451768606 205794768 205794804 181043890 181043982 635944649 635944687 791841253 791841328 848034722 848034784 953405535 953405575 284156028 284156058 113393682 113393769 19689035 19689098 28520984 28521015 53214507 53214595 601796217 601796241 800225235 800225255 817427434 817427488 657516221 657516321 321233044 321233056 372837195 372837261 503400848 503400867 124606606 124606667 733182526 733182625 541759006 541759027 106988315 106988390 406023412 406023479 52403283 52403333 941633711 941633761 846138671 846138759 713341623 7…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Busy Hall of the Rustic ribbons - MEDIUM Coding Problem | CodeTikki