CT41795

The stretches at Padmore

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the lily shoals of Padmore, Notary the clerk keeps careful count of the stretches. Prove the quality of the harvest, every figure matters. 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 <= 1443; 0 <= s < e <= 10^9.

Example 1:

Input: 476 378743893 378743906 841344764 841344786 961831063 961831133 438370411 438370441 961615783 961615849 402031500 402031518 242073868 242073926 469122971 469123007 907390094 907390145 135109357 135109399 547590239 547590258 527505458 527505501 694793388 694793434 195837121 195837143 251480832 251480901 602186106 602186180 716715551 716715574 591781939 591781963 815091569 815091640 348059223 348059300 104710593 104710607 600409341 600409405 433688133 433688231 825759286 825759348 339026716 339026746 409879549 409879599 114417835 114417886 149260439 149260469 762041930 762041989 684706608 684706626 500749629 500749669 653116708 653116763 325884622 325884710 367803123 367803215 815349387 815349473 498717795 498717864 589939820 589939853 285787398 285787425 740355689 740355700 183496574 183496…
Output: 1

Example 2:

Input: 504 703664083 703664169 497488538 497488581 509884975 509884978 30269825 30269904 248804558 248804653 528881542 528881572 692161812 692161860 748125652 748125726 804840701 804840768 817496856 817496881 404213359 404213432 511524658 511524713 74630361 74630427 461613032 461613053 414081599 414081618 384523968 384523982 630367359 630367388 775451276 775451298 598358682 598358726 208226894 208226979 769849848 769849893 204003300 204003362 15395374 15395442 956625519 956625537 660027816 660027841 151701824 151701833 856225558 856225607 663312748 663312789 543217349 543217374 742145021 742145109 795145036 795145089 761035188 761035278 727231286 727231292 661089033 661089084 244766421 244766445 318548307 318548312 485171181 485171247 307717033 307717094 959713025 959713091 890725554 890725571 36…
Output: 1

Example 3:

Input: 301 217384800 217384814 336837925 336837974 765229675 765229772 432555455 432555459 509864302 509864326 905876660 905876671 155765807 155765808 307505999 307506075 19043067 19043106 334224521 334224578 346573888 346573922 529959852 529959887 416939637 416939697 863006986 863007027 129629500 129629565 538202216 538202257 768998402 768998449 548491980 548492016 361407968 361408004 372557013 372557051 75426077 75426134 252810491 252810537 715510872 715510969 417315005 417315072 227168218 227168244 838040268 838040358 605287364 605287429 279719231 279719243 145911749 145911831 643925842 643925942 375290615 375290673 619263951 619264019 57714244 57714332 410709442 410709516 959964375 959964426 275645039 275645130 62234297 62234348 736154941 736154961 927392466 927392563 998247946 998247992 9457…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The stretches at Padmore - MEDIUM Coding Problem | CodeTikki