CT38012

Mason's windows Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Mason the auditor watches over the river town of Willowford's stores of windows. A careful computation stands between order and chaos. 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 <= 1647; 0 <= s < e <= 10^9.

Example 1:

Input: 252 832817075 832817159 964678922 964678940 165477325 165477411 760795912 760795960 969625996 969626077 781954302 781954304 934262360 934262424 866489726 866489783 443843949 443844031 934375722 934375798 137550164 137550168 746187252 746187285 285384019 285384107 377929378 377929437 932718771 932718798 776247051 776247103 125028687 125028722 804487246 804487341 710567747 710567809 851092278 851092334 907312196 907312204 98711470 98711490 274782939 274782943 16877906 16877930 202556980 202557010 853393536 853393622 349256091 349256178 715045243 715045329 523259342 523259363 933431424 933431454 762612441 762612508 683697757 683697803 355255931 355256021 744382541 744382565 981665283 981665348 849036833 849036882 381765356 381765366 124008423 124008489 650245261 650245344 99393232 99393314 86…
Output: 1

Example 2:

Input: 820 223909664 223909699 591804308 591804322 748276875 748276963 618068857 618068914 827392739 827392795 640760889 640760906 746284416 746284440 364662824 364662898 512065798 512065859 818277286 818277306 140649773 140649840 665648479 665648574 415340907 415340983 203742709 203742759 6654718 6654745 600172837 600172904 787627441 787627530 558024065 558024123 171475588 171475642 504680641 504680714 592958993 592959007 664677088 664677125 169973460 169973529 153575435 153575511 282381277 282381332 168796529 168796589 498676392 498676452 769811226 769811232 343776702 343776796 325294480 325294506 552909522 552909578 351344541 351344598 99070487 99070513 177692107 177692186 401076566 401076666 765356352 765356432 492340434 492340491 736837022 736837120 853067187 853067209 205312030 205312061 28…
Output: 1

Example 3:

Input: 462 587966871 587966940 994688831 994688900 539578208 539578247 596149711 596149741 168238548 168238597 747114317 747114383 868158651 868158704 535388516 535388615 460839048 460839140 723213497 723213544 938866955 938867044 612594009 612594073 503035678 503035683 70515531 70515552 742287947 742288043 888343273 888343297 251964304 251964353 904703715 904703738 686964028 686964079 802546809 802546892 995765808 995765867 968796613 968796650 350793471 350793525 68468672 68468714 274363798 274363827 662510071 662510080 35247749 35247766 7678766 7678851 386448962 386448992 306864620 306864672 416883313 416883338 700512025 700512088 599112874 599112933 841082586 841082633 601073067 601073100 721896862 721896945 592019819 592019896 843168454 843168540 624128301 624128387 397324271 397324322 938603…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.