CT38063

Jaya Counts the panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Jaya the customs officer watches over the orchard lands of Applerun's stores of panels. 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 <= 2233; 0 <= s < e <= 10^9.

Example 1:

Input: 793 512855924 512856002 574766127 574766202 909495978 909496003 637610520 637610542 905852468 905852488 846264240 846264310 319003761 319003853 195516265 195516326 443900656 443900704 848380422 848380456 249289125 249289220 162517417 162517467 979224196 979224214 110601438 110601441 753614822 753614918 426491867 426491918 549652382 549652383 247280860 247280902 780054951 780054959 153827998 153828092 28167731 28167742 493888652 493888682 478284289 478284386 545717240 545717291 364655129 364655138 36974926 36974930 16235557 16235581 541465041 541465048 309412448 309412511 71899434 71899515 549715216 549715269 397360575 397360588 998918875 998918907 407602281 407602346 112934987 112934988 575779311 575779392 890459000 890459007 459860253 459860293 181181003 181181007 322365726 322365770 6717…
Output: 1

Example 2:

Input: 429 802186578 802186629 491086331 491086359 709713056 709713114 484518389 484518479 852440805 852440846 335037184 335037259 17721067 17721131 47942021 47942082 570060973 570060986 498066449 498066507 207564396 207564420 809626831 809626883 70018595 70018624 110369563 110369591 54628865 54628963 676892068 676892163 57501227 57501242 611621820 611621834 891872130 891872190 617411184 617411219 237540911 237540970 567986518 567986612 608383920 608383993 28048179 28048275 272585395 272585485 827299078 827299175 544286332 544286375 978180401 978180467 907813298 907813392 105742143 105742196 43896997 43897085 989694730 989694774 286673747 286673827 210374316 210374331 917694217 917694294 103005082 103005102 650607229 650607268 595004461 595004521 613433161 613433250 397421343 397421425 472925628 …
Output: 1

Example 3:

Input: 502 242302857 242302899 553944943 553945042 126304859 126304870 348106021 348106036 855000162 855000229 866891344 866891396 353288291 353288340 689832697 689832741 863361775 863361841 323569420 323569510 847042443 847042541 927654527 927654570 336658358 336658455 771872998 771873030 105693966 105694000 4419250 4419304 427732717 427732755 869137142 869137220 157450822 157450843 904093808 904093848 442852217 442852300 14686744 14686787 309940839 309940894 807386903 807386981 469889434 469889505 224591149 224591196 411378645 411378741 415342860 415342911 246922160 246922221 36378976 36379032 111765710 111765764 12163683 12163773 717566922 717567003 118647927 118647965 460053792 460053866 955543559 955543580 908218754 908218778 925137012 925137096 79827356 79827383 648761030 648761069 72199061…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Jaya Counts the panels - MEDIUM Coding Problem | CodeTikki