CT39966

Violet windows Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Finn runs the fish market at the trading post of Goldmeadow. Today the books show a list of windows, and the numbers must be worked out before sundown. 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 <= 1849; 0 <= s < e <= 10^9.

Example 1:

Input: 1328 625309424 625309504 843002856 843002912 331708096 331708107 725710094 725710159 677989562 677989567 988543525 988543615 638541746 638541781 630843052 630843084 479484799 479484899 301300210 301300234 838960075 838960149 455543733 455543808 928135435 928135483 863068879 863068933 21063026 21063115 129117335 129117416 801989021 801989087 276312458 276312474 279109282 279109326 7958852 7958862 214671277 214671362 745903734 745903807 204251991 204252032 591471575 591471602 124125966 124126022 694634115 694634155 258304185 258304279 951194133 951194224 623923028 623923034 700425411 700425427 604492808 604492906 991391772 991391796 645300854 645300926 237330603 237330646 514158922 514158993 480169822 480169888 854257080 854257123 334640905 334640984 832899946 832899971 139500661 139500703 6…
Output: 1

Example 2:

Input: 401 297202328 297202362 858346015 858346036 470662406 470662476 830609392 830609449 734370443 734370472 317265828 317265878 321602182 321602222 64773307 64773402 4466276 4466314 260987979 260987997 354122907 354122932 615667199 615667233 709017534 709017549 742322203 742322281 731892116 731892163 54895443 54895492 793733924 793734012 823163942 823163976 906232475 906232510 946771768 946771816 18104132 18104225 319137075 319137135 616247681 616247724 225340267 225340296 584828299 584828364 729164624 729164705 397604098 397604124 346889565 346889617 661132817 661132863 309670907 309670933 812124286 812124323 575714170 575714222 629345536 629345624 996679142 996679233 80170831 80170854 576524809 576524890 383653123 383653175 861558331 861558345 119621947 119622035 278417376 278417387 54411916…
Output: 1

Example 3:

Input: 540 243921335 243921349 161409717 161409735 586696519 586696594 104392439 104392472 952973449 952973546 608386135 608386189 785078429 785078525 535403527 535403556 105901921 105901998 715439466 715439498 401496745 401496753 76605691 76605747 758620480 758620572 658772601 658772606 281907500 281907519 714685909 714685934 550276129 550276184 421573688 421573700 960471626 960471711 775648719 775648753 983176697 983176738 607115647 607115657 758495711 758495784 230651943 230651990 40366165 40366246 218479107 218479190 553912065 553912153 446336248 446336288 111602267 111602277 215343161 215343247 561872935 561873035 719894465 719894509 252915915 252915957 578341490 578341531 452119743 452119776 816449942 816450018 953101246 953101262 426101168 426101242 678797040 678797119 318320693 318320765 …
Output: 1

Constraints:

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

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