CT45522

The Glowfen Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the lantern district of Glowfen, someone must prepare the winter inventory. This year the task falls to Darian, armed only with the windows 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 <= 2609; 0 <= s < e <= 10^9.

Example 1:

Input: 547 298282628 298282718 135073865 135073956 687129712 687129771 249440608 249440691 599011667 599011764 125343238 125343290 132722256 132722353 318661361 318661448 584152985 584153036 725545798 725545865 383564986 383565069 127872132 127872133 25074434 25074520 703545828 703545841 502950713 502950806 261383740 261383782 887891469 887891489 925153700 925153790 509816246 509816305 228736501 228736571 683615143 683615149 665572139 665572219 435183700 435183793 798166017 798166042 550649022 550649043 212659085 212659105 892674657 892674680 835335226 835335251 692197400 692197422 131338251 131338275 884093413 884093453 687662811 687662859 111527378 111527446 737166256 737166350 385990428 385990514 448822166 448822265 142952951 142952974 60921951 60922019 803058951 803058975 472548181 472548188 …
Output: 1

Example 2:

Input: 47 847085908 847085912 790346439 790346512 409333033 409333080 52189702 52189738 896254326 896254417 869774393 869774454 310290930 310290937 612099211 612099292 793789532 793789587 778750707 778750791 978381162 978381262 59317771 59317805 815448157 815448160 943357717 943357769 905927195 905927203 469956601 469956641 488711207 488711216 311274828 311274902 676140427 676140514 779604842 779604892 439867695 439867734 214675860 214675951 578743458 578743469 411777099 411777168 119829283 119829304 45844063 45844119 181264789 181264819 76273171 76273193 596647395 596647469 872517846 872517863 657092757 657092828 497738320 497738328 350848313 350848359 818958262 818958295 93562651 93562665 894225175 894225236 438633225 438633296 972646595 972646646 716914935 716914955 378592775 378592785 9791615…
Output: 1

Example 3:

Input: 158 39608297 39608346 145779550 145779571 970854993 970855086 419387479 419387514 217745952 217745974 997248230 997248275 173610923 173611007 919276555 919276564 494522858 494522870 425051371 425051397 197405593 197405641 120402341 120402399 130021183 130021258 359150165 359150206 334484892 334484982 500028249 500028285 839609479 839609534 11218416 11218419 155250406 155250493 850597249 850597329 400751803 400751839 817916168 817916178 456277991 456278002 784796338 784796411 194561097 194561147 87546503 87546517 742906828 742906852 440826533 440826545 44512411 44512510 490296305 490296347 267329347 267329435 845718077 845718109 145078652 145078688 674976490 674976523 950659119 950659170 749077809 749077833 370700867 370700940 637656931 637656947 440686374 440686441 581451159 581451248 5620…
Output: 1

Constraints:

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

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