CT45633

Warden's scrolls Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Legend says the vault under the coastal hub of Tidewater opens only for a perfect tally of scrolls. Warden means to find out. 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 <= 1712; 0 <= s < e <= 10^9.

Example 1:

Input: 1492 331662011 331662102 578289400 578289486 265364074 265364146 928862550 928862615 804162696 804162734 286543573 286543666 396449068 396449097 76301618 76301718 79235497 79235522 90727690 90727790 27386793 27386814 459528281 459528346 951736234 951736236 750911690 750911691 112127924 112127997 44794170 44794253 440381986 440382079 304811154 304811238 632406218 632406240 699743421 699743439 778351492 778351554 38016131 38016208 380066094 380066135 105665723 105665730 859367051 859367121 154313284 154313341 667815064 667815099 348794436 348794512 789611300 789611343 367291884 367291907 315152878 315152888 944699621 944699659 24339424 24339426 986068471 986068516 411713647 411713727 635871626 635871664 611155303 611155339 983249922 983249945 862763869 862763931 501403294 501403362 104030487…
Output: 2

Example 2:

Input: 1705 921437687 921437753 600420657 600420739 365771079 365771172 490208824 490208911 778518210 778518242 734188922 734189001 608667634 608667729 236279315 236279401 441842522 441842534 952973000 952973079 561560991 561561010 376030772 376030813 796143220 796143231 564328059 564328062 940842923 940842972 338215203 338215260 519576752 519576805 560332855 560332943 25084244 25084341 336183307 336183313 686742619 686742647 112478203 112478248 175545442 175545453 963681799 963681824 798899303 798899327 31488023 31488039 687985409 687985464 532940423 532940443 842770666 842770703 539320800 539320843 313789623 313789636 766549451 766549463 584653407 584653505 995225625 995225697 753651174 753651274 42187731 42187799 271776611 271776615 2496798 2496800 611408202 611408249 842529123 842529126 23201…
Output: 1

Example 3:

Input: 1085 921836432 921836495 885735637 885735687 737699947 737699968 703394734 703394789 450210074 450210111 713370628 713370672 56451784 56451836 395087298 395087316 533115856 533115894 551114935 551114948 9984569 9984634 972338589 972338664 19861976 19861977 121150869 121150922 93068491 93068561 810815265 810815340 401849598 401849672 707415921 707415994 780683533 780683586 810047056 810047103 175970262 175970335 415348943 415349013 12089000 12089015 736287476 736287512 247662027 247662041 738854017 738854057 936348642 936348734 614012568 614012618 129092865 129092944 932758230 932758310 989766015 989766024 133116618 133116683 137093897 137093982 629071727 629071732 885594283 885594334 48244602 48244645 547421917 547421945 905918047 905918058 745599966 745600037 368577141 368577225 155045505…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Warden's scrolls Reckoning - MEDIUM Coding Problem | CodeTikki