CT30390

The Busy Hall at Tuskmore

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Morning light hits the boar woods of Tuskmore as Chetan unrolls the day's manifest of scrolls. The tally will decide the next shipment. 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 <= 2075; 0 <= s < e <= 10^9.

Example 1:

Input: 1712 738597000 738597069 569356153 569356211 108488609 108488687 980126517 980126574 790946099 790946122 945197355 945197388 116617896 116617932 153001872 153001927 147967283 147967326 993009760 993009784 286735962 286735971 787028227 787028292 157148227 157148321 324094736 324094795 255084420 255084492 679280879 679280957 689057130 689057168 297145039 297145114 277867432 277867514 41291494 41291575 697556638 697556670 879220627 879220691 758738587 758738686 37933234 37933262 345319992 345320074 454426421 454426468 17169178 17169200 538547918 538547950 417946646 417946720 640271477 640271551 355974106 355974127 14204352 14204449 577934750 577934769 617355199 617355267 546690654 546690655 492930024 492930052 331060103 331060131 216103943 216104006 700744281 700744356 19836711 19836769 58414…
Output: 1

Example 2:

Input: 2022 77679146 77679192 127232488 127232539 99042058 99042089 488098484 488098520 519600852 519600924 258243772 258243853 363665535 363665536 115149135 115149173 671470924 671470953 831702671 831702764 630080243 630080268 416137570 416137642 168197399 168197494 847377928 847377986 664891692 664891753 225282241 225282325 454399633 454399650 850781083 850781089 82413099 82413120 147154575 147154583 952241263 952241335 68921590 68921678 917332729 917332737 527323054 527323152 309440647 309440738 612686559 612686579 86726758 86726811 652807676 652807730 677621234 677621326 727480721 727480798 421296033 421296088 984648283 984648361 461892030 461892121 313477208 313477272 543536779 543536879 850458217 850458261 409640074 409640159 589480881 589480959 427435969 427436030 528226387 528226389 90543…
Output: 1

Example 3:

Input: 1473 691506240 691506259 91818988 91819062 453212605 453212652 280954644 280954676 878846429 878846433 858749031 858749093 915518191 915518290 5845586 5845657 206237655 206237710 516681784 516681879 768481981 768482020 766334380 766334472 264020715 264020736 75702288 75702364 76731428 76731440 37510798 37510833 849028345 849028396 745564944 745565002 918364439 918364513 404744811 404744887 530118787 530118837 640624916 640625008 861283013 861283062 114995500 114995506 159669699 159669710 201875583 201875620 401123304 401123346 509272567 509272601 889077308 889077310 584566295 584566300 26534617 26534688 411674220 411674258 707891172 707891219 124906538 124906597 473989328 473989369 28796778 28796794 665358953 665358984 485683761 485683770 2454343 2454383 582434784 582434850 68496069 684961…
Output: 1

Constraints:

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

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