CT37578

Nora's Ledger of panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the cliffside roost of Stormrest, someone must prepare the guildmaster's brief. This year the task falls to Nora, armed only with the panels register. 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 <= 2092; 0 <= s < e <= 10^9.

Example 1:

Input: 1281 327139758 327139805 87501918 87501939 90956337 90956406 573830318 573830393 49614310 49614324 290162054 290162141 493392110 493392201 195719098 195719197 858763050 858763067 437910903 437910950 211613184 211613227 361344323 361344389 634455065 634455129 393660421 393660450 998265776 998265872 81729213 81729221 633425754 633425793 88084889 88084961 570656340 570656427 723574361 723574426 161873733 161873815 294854694 294854734 755967168 755967200 958194401 958194484 869056406 869056473 707505751 707505780 155868302 155868306 744138418 744138424 892199894 892199972 225230257 225230328 219305770 219305867 21536700 21536748 323213328 323213409 203237975 203238004 4352339 4352359 40661138 40661163 625761006 625761054 21242508 21242551 750145167 750145210 789201773 789201847 506781830 50678…
Output: 1

Example 2:

Input: 375 53727897 53727910 119117935 119118033 182244090 182244134 762849832 762849866 34212168 34212210 663299608 663299657 701233978 701234038 878851786 878851846 835313733 835313803 121080891 121080954 819739388 819739448 280137162 280137171 450909108 450909187 407115922 407115998 297690257 297690340 109476223 109476280 617136417 617136512 431552485 431552581 705046732 705046737 789934003 789934062 433518230 433518271 597917526 597917605 898437674 898437740 907550817 907550829 336656905 336656982 492011647 492011723 676427763 676427815 720300551 720300625 955601436 955601481 461099385 461099398 712147766 712147845 640794754 640794809 672971384 672971439 882380084 882380118 219885137 219885201 1071403 1071489 529383166 529383265 889737894 889737903 986407658 986407665 629525232 629525324 9775…
Output: 1

Example 3:

Input: 1928 347930644 347930728 857513528 857513590 651062657 651062752 690267570 690267667 773030355 773030389 638280827 638280906 545778137 545778177 922159132 922159148 443176559 443176645 692345900 692345926 4165329 4165404 790593376 790593446 107683255 107683307 199503253 199503318 933448163 933448172 286001797 286001821 157105282 157105335 369104711 369104738 458829361 458829407 639464515 639464584 66833557 66833637 940474754 940474762 712104076 712104111 704592702 704592723 169791219 169791246 810851335 810851357 99475445 99475448 892027854 892027866 997593894 997593915 493690633 493690680 680632721 680632785 541515287 541515357 80286958 80287012 493369456 493369464 664461113 664461188 887255060 887255157 548470036 548470038 220482347 220482397 865264646 865264726 729627798 729627830 55742…
Output: 1

Constraints:

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

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