CT45723

Hope's stretches Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the savanna camp of Amberplain. Hope spreads the stretches records across the table and picks up a sharp pencil. 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 <= 2017; 0 <= s < e <= 10^9.

Example 1:

Input: 912 932329922 932330012 663721908 663721978 954871263 954871267 878307074 878307129 726679983 726679988 15477986 15478013 74582059 74582090 513195721 513195736 213426186 213426228 505653047 505653095 90647238 90647260 832140688 832140744 535039118 535039124 894880674 894880756 299558935 299558936 492362930 492362988 495628458 495628482 296454317 296454377 104172658 104172729 198126153 198126251 140476265 140476280 928499502 928499508 179955227 179955295 621473807 621473864 232156559 232156565 484095101 484095190 4566603 4566670 255715444 255715451 543336194 543336289 587769400 587769480 67564401 67564459 740551246 740551264 867491899 867491931 486408849 486408887 679894739 679894749 264445183 264445258 199960055 199960120 211288144 211288210 211007376 211007474 214659669 214659691 15062301…
Output: 1

Example 2:

Input: 102 431321929 431321968 854144332 854144349 188799069 188799125 933635824 933635879 804514209 804514227 788161446 788161485 553890704 553890748 849494316 849494393 356182280 356182370 4882443 4882463 190391618 190391686 526493560 526493562 86641988 86642048 165821951 165821965 163348202 163348213 562528739 562528757 799729474 799729519 810459481 810459512 713749666 713749669 355367912 355367934 432232267 432232290 392566537 392566600 39490321 39490349 884196354 884196364 653486143 653486205 395999898 395999971 724139453 724139521 655966429 655966464 985047520 985047620 891635894 891635968 202796397 202796424 629412441 629412502 24154531 24154533 450373654 450373662 770935810 770935889 614285440 614285521 795297230 795297328 36173366 36173436 224977008 224977105 749521220 749521310 51030684…
Output: 1

Example 3:

Input: 1412 565966901 565966965 732439461 732439519 841952216 841952268 426756008 426756099 978869186 978869244 86577177 86577211 221479759 221479844 662035009 662035043 269773490 269773573 579560070 579560113 317104992 317105073 653117059 653117112 181472460 181472520 82870407 82870411 49035584 49035671 943987910 943987935 923991654 923991691 30374918 30374950 318583319 318583337 910311923 910311975 109427140 109427239 356163043 356163066 300838192 300838283 412416123 412416202 513169577 513169648 757862895 757862969 957143172 957143229 582720959 582720973 690752464 690752492 57978911 57978959 971739486 971739543 675055014 675055035 810961736 810961824 851049321 851049408 147107691 147107790 726271797 726271871 594286990 594287037 970513574 970513598 547827932 547827966 536824336 536824339 33404…
Output: 1

Constraints:

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

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