CT45203

Last scrolls of Pia

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the tundra station of Whitesnow close for winter, Pia must finish the scrolls 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 <= 1620; 0 <= s < e <= 10^9.

Example 1:

Input: 293 331643299 331643333 88982637 88982733 819477438 819477536 403173129 403173228 13324292 13324316 504464212 504464241 355769099 355769100 493670349 493670444 493949261 493949345 731601190 731601290 578306936 578307015 790302933 790302976 980225898 980225987 796651426 796651466 493753737 493753809 981575657 981575720 281748107 281748165 353889989 353890037 304866980 304867071 840235271 840235349 224635874 224635922 514064650 514064723 633242443 633242446 798129089 798129128 863411264 863411328 927178448 927178452 21359530 21359576 309516120 309516175 38393539 38393608 684204079 684204173 997972376 997972476 204126656 204126697 363248895 363248948 684728206 684728261 707934027 707934065 615090359 615090444 882551223 882551313 87356966 87357014 710941489 710941550 179342919 179343005 689768…
Output: 1

Example 2:

Input: 1544 358106996 358107021 406460075 406460174 16599530 16599549 507396151 507396225 878626970 878627051 627717046 627717114 208069800 208069816 160045292 160045349 808837159 808837207 907501113 907501205 126056549 126056573 125103061 125103119 564380846 564380847 559561292 559561365 874218677 874218711 542489665 542489699 676283931 676283939 100699569 100699573 645272797 645272841 672392921 672392970 369527427 369527499 208527145 208527151 347601132 347601215 711347089 711347133 482737299 482737302 409542152 409542235 733748940 733748941 316033226 316033288 951203838 951203889 389300997 389301050 550382639 550382648 63205379 63205460 919469620 919469626 541367716 541367730 884549338 884549340 687584905 687584908 803948774 803948830 336107846 336107870 324484201 324484291 984375625 984375694…
Output: 1

Example 3:

Input: 1367 332757414 332757479 422013262 422013314 129780180 129780215 452878154 452878243 75035453 75035476 329752091 329752152 388049291 388049371 986089172 986089252 420781484 420781559 175859123 175859135 868763794 868763876 967497607 967497666 299414776 299414810 978003882 978003887 944699946 944700035 122731188 122731225 488792454 488792489 120617408 120617434 566213930 566214007 776676840 776676887 628117004 628117057 375486573 375486663 967964757 967964843 751006319 751006348 697325116 697325166 776415279 776415290 854033466 854033520 816752131 816752169 674215192 674215292 509638632 509638694 634497627 634497639 57844059 57844121 104121172 104121231 245398238 245398288 929730657 929730740 889248523 889248609 100412964 100413033 355229906 355229945 701772762 701772857 538002959 538002989…
Output: 1

Constraints:

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

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