CT41315

Gita and the Crystal panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the quartz ridge of Glimmerfell close for winter, Gita must finish the panels ledger - one figure at a time. 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 <= 2289; 0 <= s < e <= 10^9.

Example 1:

Input: 1155 324072725 324072795 298470296 298470386 711655384 711655423 652267286 652267313 171660760 171660834 306830395 306830422 553034371 553034407 561330440 561330532 130701957 130701989 70074681 70074717 910215108 910215192 753544993 753545028 338171465 338171542 628650349 628650388 952833669 952833729 311894760 311894851 992293029 992293040 813002846 813002926 843504190 843504269 337198626 337198705 85766132 85766154 796336286 796336336 972649294 972649370 27576295 27576303 703777856 703777894 432879893 432879914 201857101 201857145 300571178 300571185 651469727 651469761 754724707 754724781 397579277 397579366 598503967 598504051 233832049 233832131 685630229 685630287 341107683 341107695 854505561 854505570 879269445 879269534 762395019 762395082 276658638 276658648 693390797 693390837 6…
Output: 1

Example 2:

Input: 417 448973369 448973437 439238864 439238961 934541344 934541351 126591720 126591726 169056025 169056117 931776193 931776241 558961533 558961631 967726928 967727025 651026044 651026073 218751250 218751282 11990319 11990346 311958916 311958980 632970024 632970114 295010543 295010545 985427961 985427974 575173124 575173179 108935963 108935977 488727316 488727381 929253482 929253582 910396856 910396877 628181400 628181477 273289223 273289282 793710178 793710192 841057736 841057799 931817229 931817292 330347609 330347636 675352619 675352660 241596384 241596434 633344847 633344874 539072811 539072815 555716285 555716322 902826738 902826798 190641011 190641014 895011001 895011026 562196959 562197050 94098018 94098053 794641955 794641968 459306083 459306111 25312449 25312453 69210473 69210554 5282…
Output: 1

Example 3:

Input: 1285 408413707 408413751 394101908 394101956 93068768 93068858 144167435 144167469 296857186 296857223 317028605 317028663 198933388 198933463 761425383 761425473 219633257 219633324 354495255 354495285 962408790 962408861 504727991 504728051 516043142 516043145 101673623 101673671 723603998 723604008 306470835 306470932 460793590 460793615 258906645 258906648 923929217 923929312 283814698 283814729 309255508 309255569 294495284 294495288 319145847 319145857 607219206 607219215 937007049 937007138 701049829 701049911 330902014 330902026 11870550 11870628 957921629 957921636 863784887 863784984 352193212 352193217 882155479 882155536 701798973 701799048 854876660 854876697 979376062 979376093 170658005 170658040 4754091 4754098 632479356 632479363 551943828 551943880 140250346 140250363 867…
Output: 1

Constraints:

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

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