CT30733

The Busy Hall at Scriptoria

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Cleo runs the exchange at the ink district of Scriptoria. Today the books show a list of ribbons, 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 <= 2099; 0 <= s < e <= 10^9.

Example 1:

Input: 1692 62163855 62163921 916272014 916272093 421545942 421545981 492899701 492899764 472618446 472618480 327954469 327954471 556109502 556109574 812245534 812245570 673278422 673278450 103994798 103994864 650137529 650137578 578477535 578477570 444895180 444895242 694896038 694896095 720921472 720921505 40038164 40038262 889420622 889420677 609160859 609160911 17292272 17292339 891229450 891229538 599086774 599086822 8081613 8081671 906887708 906887736 660657464 660657490 567561578 567561593 999051455 999051501 816261845 816261916 478328789 478328825 556090984 556091071 857599794 857599883 655107267 655107313 853076788 853076843 75360823 75360900 377532441 377532538 842975307 842975403 113830757 113830820 275972206 275972304 571067080 571067094 12659318 12659367 839417641 839417648 400938698…
Output: 1

Example 2:

Input: 467 970060810 970060832 158830020 158830078 760833909 760833931 372579355 372579430 799145398 799145443 300821415 300821452 390791237 390791309 49853854 49853887 548431782 548431833 734683249 734683348 808454092 808454126 209471053 209471089 608548564 608548638 746134039 746134069 976218017 976218117 23144763 23144775 978323220 978323230 703519407 703519468 75424035 75424066 931639384 931639387 21726930 21726949 377779641 377779710 656331742 656331782 341104273 341104349 823303675 823303683 895134390 895134420 280570565 280570634 584598687 584598693 849472743 849472840 641495567 641495645 857608839 857608923 96837810 96837877 425230340 425230396 282586320 282586353 270814539 270814581 316721851 316721920 580597144 580597238 160501360 160501371 567876061 567876114 502600764 502600822 642855…
Output: 1

Example 3:

Input: 211 287030162 287030209 805544246 805544342 631378795 631378892 199275818 199275898 726942712 726942740 195654665 195654763 829869614 829869712 958427776 958427787 940507898 940507912 518297334 518297352 147974657 147974699 310820903 310820911 491532183 491532278 114482573 114482665 288121310 288121389 90223598 90223625 722015995 722016062 962952675 962952766 451494513 451494585 557226284 557226303 477323970 477324022 733962162 733962246 839837730 839837745 713643150 713643176 401853746 401853752 763491958 763492027 6594401 6594476 605526026 605526113 923578920 923578943 931717323 931717414 57000488 57000573 339259078 339259138 366806931 366806946 133497850 133497898 121522967 121523041 857083220 857083250 717401658 717401722 384758627 384758700 10631853 10631896 370254481 370254514 270329…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Busy Hall at Scriptoria - MEDIUM Coding Problem | CodeTikki