CT30736

The Violet Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Trader inherited the exchange at the zephyr cliffs of Galeholm along with its curious bookkeeping system for ribbons. 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 <= 1223; 0 <= s < e <= 10^9.

Example 1:

Input: 739 262563749 262563786 115883490 115883577 637215380 637215442 113729745 113729761 597300671 597300753 867679340 867679408 309532590 309532689 245980438 245980509 708669172 708669263 800176198 800176266 171713869 171713911 687190208 687190222 263232845 263232849 307393063 307393089 385076234 385076307 212352225 212352299 86176813 86176842 437788946 437788977 595168587 595168662 291721244 291721266 296259277 296259336 165736755 165736787 657557626 657557654 942176539 942176630 223241708 223241712 533464296 533464347 837145570 837145619 630575611 630575615 569414222 569414272 426676625 426676713 950793974 950794006 620957703 620957709 639875583 639875657 333548219 333548220 460769448 460769471 14294956 14294957 674136642 674136683 576807843 576807909 444773555 444773634 786856700 786856776 …
Output: 2

Example 2:

Input: 681 184251337 184251341 718473370 718473440 299702011 299702074 826548607 826548656 423753531 423753630 847652688 847652763 350417719 350417817 575990602 575990634 540462284 540462368 289536120 289536203 472715197 472715272 624019346 624019435 754347306 754347371 370045560 370045601 700265119 700265212 358656273 358656328 292134120 292134204 984197251 984197258 81590365 81590413 634569494 634569564 598812896 598812926 13850957 13851030 783918931 783918963 142389014 142389057 899837572 899837626 239665533 239665557 353840608 353840669 470175902 470175958 114434806 114434904 790097774 790097813 701317966 701318025 883803798 883803893 798240395 798240429 826010830 826010867 197429325 197429340 867626078 867626132 351245184 351245207 857068674 857068744 322003993 322004073 686141126 686141147 …
Output: 1

Example 3:

Input: 1185 524798002 524798028 848094294 848094355 717224323 717224389 92029247 92029292 908058479 908058531 593863111 593863121 369403524 369403526 400148986 400149083 713597920 713597993 716720233 716720315 306470476 306470562 633988699 633988790 946603892 946603929 743989328 743989350 180533819 180533898 698541871 698541967 395822379 395822390 31617308 31617373 751913985 751914067 453332356 453332453 990782484 990782539 643694127 643694222 532075960 532076008 528178008 528178104 643748553 643748608 383009309 383009321 123397161 123397255 757707041 757707078 451013833 451013876 767846487 767846539 821376316 821376404 64609970 64610014 881701341 881701399 651428202 651428259 654751840 654751875 589626443 589626485 749085785 749085879 779624099 779624148 985646251 985646302 358905524 358905567 5…
Output: 1

Constraints:

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

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