CT37395

Starlit panels Busy Hall

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the steppe camp of Horselord Plains. Zaid spreads the panels 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 <= 1512; 0 <= s < e <= 10^9.

Example 1:

Input: 942 70548516 70548597 483459267 483459309 681356141 681356149 549250915 549250968 715627074 715627145 279640543 279640622 817489503 817489544 822329487 822329497 552694243 552694254 677030501 677030534 741300917 741300989 645258734 645258803 988317868 988317956 775623034 775623058 563790781 563790811 447059285 447059329 108543075 108543158 307118595 307118624 818884983 818885048 485598500 485598520 457790983 457790993 211056793 211056822 623313137 623313154 424998053 424998122 651725086 651725135 879208989 879209073 359253266 359253312 669859181 669859189 915331967 915332012 309850002 309850017 239468197 239468255 787891480 787891513 530382594 530382657 423570027 423570073 58154039 58154042 747906568 747906606 5402543 5402609 340253801 340253831 477237733 477237822 337850963 337851047 9229…
Output: 1

Example 2:

Input: 765 337685960 337686000 159536985 159537007 576639636 576639651 360251340 360251410 812505593 812505665 975177429 975177474 470255681 470255742 204894437 204894519 467225437 467225481 71812823 71812850 994277684 994277757 718352511 718352539 94216313 94216377 503367972 503368014 435387466 435387490 958694637 958694698 292691934 292691948 670567791 670567812 328159112 328159211 453312030 453312038 321451088 321451118 475805707 475805796 60278320 60278399 91868252 91868300 28933332 28933407 657842233 657842287 919674198 919674293 998084336 998084372 919886151 919886243 737303542 737303561 275665918 275665926 958165631 958165723 115469860 115469940 815113608 815113650 336393404 336393451 511231219 511231226 946064292 946064295 733452701 733452712 145566361 145566395 456672612 456672615 511785…
Output: 1

Example 3:

Input: 1412 376267163 376267249 998171271 998171333 922266359 922266412 351529197 351529232 538603295 538603354 392637017 392637050 818418374 818418464 738625484 738625563 631330629 631330716 736020817 736020840 991152191 991152221 565767447 565767534 811641435 811641519 725229088 725229162 680433046 680433077 206243847 206243857 346610084 346610154 882540339 882540391 807868844 807868874 15014924 15014940 176727663 176727707 859576335 859576379 61683072 61683122 3606893 3606982 8539537 8539578 511602878 511602881 186915296 186915356 230658193 230658221 363738630 363738632 750362065 750362107 56472701 56472771 412942740 412942802 978365539 978365591 655197113 655197176 335304391 335304456 26184084 26184092 190568007 190568062 210711811 210711847 471113985 471114066 102221510 102221585 11203129 11…
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Starlit panels Busy Hall - MEDIUM Coding Problem | CodeTikki