CT31790

The Galeholm Busy Hall

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Legend says the vault under the zephyr cliffs of Galeholm opens only for a perfect tally of scrolls. Xavi 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 <= 2715; 0 <= s < e <= 10^9.

Example 1:

Input: 848 434011278 434011362 263831967 263831977 959907998 959908045 640783600 640783698 558315936 558315975 545045111 545045181 859445677 859445748 516057108 516057120 531392656 531392727 949406068 949406088 8285733 8285814 279095215 279095231 191423328 191423377 451339948 451340035 864192097 864192116 494265167 494265264 984726341 984726421 270366280 270366379 453565711 453565733 972931092 972931113 34864086 34864154 536692307 536692404 300238207 300238232 274093974 274093985 320238095 320238105 765513866 765513956 396155686 396155747 625189196 625189198 642105758 642105822 74644186 74644214 228471882 228471979 802159849 802159896 976828981 976829029 135949223 135949294 117851653 117851703 332710027 332710092 385555678 385555731 627189073 627189142 914668671 914668713 47969523 47969580 465923…
Output: 1

Example 2:

Input: 1029 859833391 859833398 911128573 911128618 751730348 751730367 536164042 536164085 758162787 758162856 448867178 448867255 72751864 72751869 109936620 109936711 291170523 291170598 420621190 420621257 178010941 178010974 33062376 33062380 362720744 362720793 589475819 589475865 767036270 767036344 911246138 911246179 818419667 818419684 182866974 182867012 393893271 393893308 63826777 63826793 628681275 628681305 258251724 258251729 118299152 118299206 180165150 180165210 697891992 697892091 490291305 490291361 208704850 208704853 177284528 177284540 492189273 492189319 312708152 312708250 66464091 66464184 864726158 864726203 903061221 903061313 877818632 877818677 11157515 11157585 844310746 844310842 776056559 776056595 317380162 317380248 765256097 765256156 332299681 332299754 20051…
Output: 1

Example 3:

Input: 1692 174658398 174658421 731449214 731449298 822323911 822324002 529595201 529595252 167530275 167530299 596144429 596144515 203162480 203162508 961366837 961366915 876780147 876780246 731431935 731431975 700945525 700945591 723824937 723824963 11096749 11096827 509821579 509821654 311285680 311285699 890097559 890097609 74692776 74692864 783649593 783649666 315619761 315619857 789970860 789970869 605211615 605211706 825037043 825037051 126760708 126760786 496628781 496628855 264281539 264281554 710050726 710050736 866522423 866522432 964644523 964644572 459614334 459614404 901718231 901718252 843801460 843801535 242615987 242616081 859967052 859967097 239789172 239789229 676152414 676152467 991533833 991533924 689611255 689611336 246864383 246864448 112627205 112627296 920177824 920177922…
Output: 1

Constraints:

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

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