| 1234567 |
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 820 260" role="img" aria-labelledby="title desc">
- <title id="title">Manacher 的镜像半径</title><desc id="desc">已知回文区间内,新中心可从其镜像中心借用至少一部分半径。</desc>
- <style>text{font-family:system-ui,sans-serif;fill:#172033}.cell{fill:#f8fafc;stroke:#64748b;stroke-width:2}.inside{fill:#dbeafe}.center{fill:#fef3c7;stroke:#d97706;stroke-width:4}.note{font-size:18px}.label{font-size:21px;font-weight:700}</style>
- <text x="28" y="30" class="note">蓝框 [L,R] 已验证为回文;右侧中心 i 可向左借镜像 m 的信息。</text>
- <g transform="translate(108 88)"><rect class="cell inside" x="0" y="0" width="72" height="55"/><rect class="cell inside" x="72" y="0" width="72" height="55"/><rect class="cell inside" x="144" y="0" width="72" height="55"/><rect class="cell inside" x="216" y="0" width="72" height="55"/><rect class="cell inside" x="288" y="0" width="72" height="55"/><rect class="cell inside" x="360" y="0" width="72" height="55"/><rect class="cell inside" x="432" y="0" width="72" height="55"/><rect class="cell" x="504" y="0" width="72" height="55"/><text class="label" x="28" y="35">a</text><text class="label" x="100" y="35">b</text><text class="label" x="172" y="35">a</text><text class="label" x="244" y="35">c</text><text class="label" x="316" y="35">a</text><text class="label" x="388" y="35">b</text><text class="label" x="460" y="35">a</text><text class="label" x="532" y="35">x</text><circle class="center" cx="180" cy="27" r="22"/><circle class="center" cx="396" cy="27" r="22"/></g>
- <path d="M324 75 L324 170" stroke="#475569" stroke-width="3" stroke-dasharray="8 6"/><text x="278" y="194" class="note">旧中心</text><text x="251" y="221" class="note">m</text><text x="468" y="221" class="note">i</text><text x="105" y="245" class="note">i 的镜像 m = L + R - i;超过 R 的部分才需要新比较。</text>
- </svg>
|