CT29491

Quiet stretches Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the canyon post of Redrock close for winter, Jatin must finish the stretches ledger - one figure at a time. 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 <= 2555; 0 <= s < e <= 10^9.

Example 1:

Input: 496 461730586 461730683 866406740 866406793 994745135 994745164 730352697 730352789 953662994 953663034 293680774 293680853 403486724 403486785 788189620 788189643 123603166 123603189 60979343 60979391 803587908 803587928 694506621 694506637 150203509 150203530 184092523 184092553 901673411 901673494 662184839 662184923 462574438 462574475 380848107 380848115 349001144 349001153 317781199 317781227 997576451 997576496 988642288 988642321 609586510 609586560 461997966 461998047 890371208 890371231 420196549 420196644 477429228 477429260 721449951 721449981 356050494 356050562 394951000 394951016 265215037 265215123 736965568 736965594 683102651 683102709 97527288 97527295 243850693 243850710 728526417 728526469 895715963 895716017 169494302 169494360 916559746 916559777 12453309 12453357 74…
Output: 1

Example 2:

Input: 1379 393557130 393557133 703289861 703289913 58021811 58021886 750195632 750195643 894194134 894194192 529678968 529678982 601573619 601573645 379982221 379982222 400835072 400835157 301569333 301569364 536488745 536488816 672111062 672111088 401333030 401333050 882562585 882562639 194559458 194559540 313944673 313944700 431178554 431178582 380331391 380331431 187339284 187339347 445840396 445840400 812163180 812163191 717343510 717343524 976393296 976393309 665574352 665574448 667682858 667682885 472891706 472891753 740641793 740641884 310940673 310940738 665123422 665123448 791618174 791618235 853256759 853256854 846819646 846819695 402691512 402691586 875960253 875960341 300534366 300534446 852210345 852210368 245394662 245394756 619126294 619126387 437461857 437461868 759702525 7597026…
Output: 1

Example 3:

Input: 694 420650458 420650490 158720637 158720716 214384700 214384793 89852561 89852637 492774095 492774127 678095057 678095142 727525879 727525953 444787690 444787727 769149739 769149799 114353414 114353509 53173028 53173032 629395635 629395639 330769769 330769791 850697894 850697989 492492443 492492444 14348168 14348231 362407351 362407401 971298297 971298374 817139049 817139136 104119202 104119233 112946415 112946437 317111968 317112002 102464574 102464633 429377639 429377662 827164611 827164655 372571880 372571889 623001995 623002000 342272537 342272560 534179665 534179714 277089242 277089320 161730457 161730477 886270615 886270640 505896046 505896145 412044221 412044250 119292848 119292870 613439801 613439853 103839650 103839716 658513051 658513057 173228797 173228869 579387392 579387403 13…
Output: 1

Constraints:

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

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