CT32184

Last windows of Yash

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The council of the island market of Coralcove pays by the answer, and Yash intends to earn it. First: the full register of windows. 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 <= 1034; 0 <= s < e <= 10^9.

Example 1:

Input: 352 232890581 232890676 326677799 326677813 643103639 643103732 333910645 333910681 988072279 988072347 653393791 653393849 214144683 214144702 897002722 897002754 335780236 335780317 303274139 303274238 806468716 806468762 112197780 112197838 790743131 790743141 342577493 342577562 542924690 542924734 25447431 25447505 801055548 801055610 480868654 480868692 334592240 334592246 722472951 722472991 790388766 790388809 348664191 348664216 960865933 960865976 874278667 874278722 22201270 22201326 713006509 713006550 260517485 260517544 610232509 610232567 958944984 958945052 68148921 68148948 584650596 584650670 955557960 955557981 948717363 948717430 444354287 444354350 371764547 371764633 624944142 624944201 948316708 948316758 458276928 458276929 384090648 384090741 564810057 564810073 46…
Output: 1

Example 2:

Input: 344 712518040 712518120 459202888 459202985 629277483 629277574 160483725 160483773 363415284 363415348 926749489 926749571 371335512 371335556 35729566 35729607 216808624 216808677 850025103 850025127 142579063 142579111 957177536 957177557 845249467 845249543 376108568 376108593 694637753 694637775 93461209 93461302 971013209 971013253 875313907 875313919 597876944 597876992 41337189 41337253 72597387 72597450 143632312 143632334 78655882 78655905 515586291 515586374 775112678 775112732 154585588 154585663 63387892 63387950 370339688 370339748 345770793 345770854 206425694 206425761 469271677 469271768 276634593 276634615 859794072 859794080 147552501 147552544 396516630 396516641 952706246 952706330 36931575 36931647 555165674 555165736 815801525 815801559 910925772 910925795 309715864 …
Output: 1

Example 3:

Input: 883 848228831 848228878 168789012 168789089 555574832 555574914 677515685 677515746 552126572 552126573 316811697 316811739 236191288 236191347 175044620 175044681 713658937 713658992 723799347 723799426 986173576 986173591 686426583 686426636 961259462 961259550 602558534 602558544 10874446 10874461 774894480 774894549 97406857 97406865 612044371 612044443 584084610 584084628 490726615 490726705 424877095 424877181 624172530 624172625 560559939 560559980 916347628 916347641 932628438 932628503 440910771 440910784 937583442 937583525 186112791 186112836 585591704 585591765 604623177 604623261 138643288 138643375 892851201 892851211 904812765 904812818 810465164 810465194 407814341 407814397 126554716 126554815 234911705 234911738 978460907 978460957 200558899 200558940 392457232 392457283 …
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last windows of Yash - MEDIUM Coding Problem | CodeTikki