CT31434

Trader and the Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the ember mines of Cindercrag; Trader weighs the day's stretches manifests and starts the calculations. 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 <= 1037; 0 <= s < e <= 10^9.

Example 1:

Input: 655 72737054 72737088 881972381 881972456 398751623 398751632 363014838 363014909 217773568 217773587 942676588 942676653 648567849 648567893 32791753 32791817 340387719 340387771 636503088 636503138 728128319 728128416 626131238 626131280 366632971 366633011 191520545 191520625 617617661 617617702 85467050 85467072 679148992 679149075 685500244 685500261 301511628 301511703 87535874 87535886 152894487 152894526 360793468 360793536 259109228 259109247 762740420 762740511 658180365 658180451 231939281 231939381 670642854 670642920 17560614 17560682 450090289 450090320 307205708 307205711 572913201 572913284 517649164 517649256 794441235 794441308 849263658 849263731 172814674 172814748 867031025 867031123 707788885 707788915 85506522 85506545 891100205 891100221 696550502 696550553 81193335…
Output: 1

Example 2:

Input: 503 158002135 158002209 241260963 241260997 749795943 749795952 418449627 418449659 735965285 735965325 613193361 613193410 159477592 159477600 668628996 668629006 668420910 668420992 415315232 415315323 852703648 852703681 925850661 925850671 309414007 309414098 527675830 527675913 195541711 195541745 103016177 103016220 255225743 255225756 187668257 187668258 660386703 660386740 119539427 119539518 596627725 596627743 969396764 969396799 87583205 87583263 647247517 647247580 264918134 264918150 963405077 963405154 543576084 543576124 169206167 169206267 154163844 154163877 619441203 619441275 464526092 464526163 195310631 195310635 849073783 849073785 725584553 725584569 409134873 409134894 873585546 873585548 611514132 611514224 30796325 30796355 56465986 56466078 437964117 437964126 24…
Output: 1

Example 3:

Input: 865 830568591 830568639 484140572 484140639 744643322 744643323 434932876 434932892 585098401 585098456 190010771 190010868 615205843 615205926 617642659 617642713 906169289 906169331 416867536 416867541 46871195 46871263 329003576 329003674 423597108 423597183 643307546 643307603 298783741 298783752 36000015 36000046 679736227 679736230 92901613 92901633 662272063 662272150 288925071 288925152 966121985 966122033 451374160 451374187 515892952 515893050 414083470 414083538 393874245 393874335 937345162 937345177 473673086 473673134 300528800 300528851 650948488 650948532 497920099 497920197 577901317 577901406 122447065 122447079 262037378 262037413 209828814 209828912 511869506 511869605 953255729 953255750 121323152 121323204 155060932 155060962 450146107 450146135 181492317 181492409 15…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Trader and the Busy Hall - MEDIUM Coding Problem | CodeTikki