CT45213

Ember windows Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Forester inherited the kitchen at the ribbon falls of Cascade Vale along with its curious bookkeeping system for windows. Time to make sense of it. 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 <= 1238; 0 <= s < e <= 10^9.

Example 1:

Input: 1052 728162796 728162868 246796714 246796752 769291608 769291663 657789418 657789477 98804978 98805007 327551751 327551802 982395892 982395916 6536724 6536820 512149205 512149212 89583950 89584041 800615704 800615760 268930408 268930504 144427641 144427672 404078233 404078305 426664278 426664333 540662864 540662960 521804768 521804796 998857844 998857903 376798127 376798182 546069992 546070004 746788021 746788066 238474722 238474795 603616387 603616402 646183810 646183849 821462392 821462482 761871037 761871100 313559638 313559651 793715287 793715353 976360369 976360444 118569200 118569299 727776230 727776330 687111145 687111231 850078864 850078930 76529613 76529619 913687833 913687929 550703889 550703988 554025538 554025590 453274631 453274639 989651725 989651820 323375384 323375426 37865…
Output: 1

Example 2:

Input: 1029 520100607 520100680 437287400 437287434 163050942 163051031 981466246 981466282 303286468 303286566 443275660 443275689 63590142 63590178 775093484 775093562 766794373 766794411 337944378 337944424 456224748 456224755 566390318 566390381 840492659 840492706 501542191 501542261 149930717 149930729 589556440 589556531 814339082 814339085 424763618 424763702 682223236 682223293 885531404 885531435 811147654 811147677 376822634 376822708 310184074 310184143 372205493 372205549 122494762 122494792 334915110 334915165 611801778 611801856 919063150 919063166 467879382 467879442 900984135 900984225 473034317 473034373 404135923 404135937 791798907 791798930 132203070 132203112 216866378 216866450 774647519 774647618 680566708 680566736 188152971 188153025 816461750 816461777 413394000 4133940…
Output: 1

Example 3:

Input: 245 85524856 85524947 941021606 941021655 474056693 474056730 337108727 337108738 884855804 884855857 750619133 750619148 247972189 247972276 119897405 119897439 361307077 361307087 9921809 9921845 284400140 284400188 285593537 285593607 938896976 938896996 644866676 644866721 315292071 315292132 352767077 352767120 591072284 591072371 170310233 170310285 692681405 692681444 477233762 477233766 819753960 819754037 907320192 907320198 424165681 424165779 934683827 934683885 892209950 892210030 860286703 860286759 262608291 262608379 832642587 832642669 990043994 990044045 336500181 336500252 652840203 652840298 822875140 822875155 817521751 817521832 821732077 821732110 93980437 93980498 303465197 303465214 242981693 242981718 288639842 288639916 466069844 466069901 180622354 180622446 3183…
Output: 1

Constraints:

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

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