CT36395

Vermilion ribbons Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

At the mining town of Ironvein, Tanya records each ribbons in a worn leather ledger. The guild wants answers, not guesses. 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 <= 2548; 0 <= s < e <= 10^9.

Example 1:

Input: 1682 378595176 378595184 929357234 929357296 903308076 903308135 746862801 746862861 70727556 70727633 707388920 707388947 334751263 334751273 381138269 381138313 55475267 55475338 977655971 977656053 454131855 454131863 368244793 368244850 980161468 980161531 669971661 669971756 405916643 405916740 508875902 508875995 484084053 484084132 284555651 284555668 725816962 725817043 412076229 412076276 646021916 646021928 641663004 641663073 53589358 53589449 798970982 798971076 138788422 138788447 337115413 337115414 572556397 572556477 336571746 336571773 362617035 362617075 447086707 447086727 733114845 733114925 634398191 634398286 499510924 499511010 136766904 136766915 372654495 372654517 744500214 744500216 276983094 276983098 133478641 133478702 861801229 861801288 618514141 618514234 6…
Output: 1

Example 2:

Input: 595 875173925 875173941 71397780 71397824 21207367 21207394 722200781 722200811 429655121 429655154 412073397 412073468 875924965 875925002 834177327 834177363 806289819 806289849 685465066 685465164 289070485 289070521 5270655 5270666 98989377 98989428 546897815 546897850 691313697 691313784 583246254 583246333 47917813 47917822 211024839 211024883 867524476 867524496 572824624 572824695 895881690 895881745 801141191 801141259 929024175 929024263 462862818 462862851 572823079 572823175 421881950 421882021 811323140 811323226 4310097 4310161 919989704 919989770 485631581 485631677 828298839 828298869 89510535 89510540 277896155 277896252 515348057 515348120 914003423 914003506 391872007 391872096 857044450 857044501 116896735 116896751 934145769 934145787 211211476 211211494 164695169 1646…
Output: 1

Example 3:

Input: 181 45235390 45235394 626681156 626681174 206945694 206945711 364004759 364004765 282324328 282324329 572744049 572744132 423729860 423729928 193468434 193468521 640649849 640649875 577129182 577129234 82816618 82816708 834201412 834201421 931057447 931057487 935912723 935912751 943745883 943745983 33995208 33995217 392964041 392964122 657270202 657270224 825866372 825866423 173866222 173866257 309785372 309785398 796610238 796610312 526580167 526580247 892970273 892970343 888966872 888966950 332029530 332029599 599637685 599637711 291638334 291638344 257113625 257113671 436532464 436532507 941214011 941214110 557737890 557737973 441070248 441070261 17603918 17604011 146935425 146935505 485011974 485012054 470367149 470367208 738774908 738775003 956968676 956968749 10835629 10835692 373400…
Output: 1

Constraints:

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

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