1
0

00-ODT-01-把数组压成段.svg 2.1 KB

123456789101112
  1. <svg xmlns="http://www.w3.org/2000/svg" width="940" height="285" viewBox="0 0 940 285">
  2. <style>.t{font:16px sans-serif;fill:#1f2937}.s{font:13px sans-serif;fill:#475569}.cell1{fill:#dbeafe;stroke:#2563eb;stroke-width:2}.cell4{fill:#fef3c7;stroke:#d97706;stroke-width:2}.cell2{fill:#dcfce7;stroke:#16a34a;stroke-width:2}.card1{fill:#dbeafe;stroke:#2563eb;stroke-width:3}.card4{fill:#fef3c7;stroke:#d97706;stroke-width:3}.card2{fill:#dcfce7;stroke:#16a34a;stroke-width:3}.a{stroke:#16a34a;stroke-width:4;fill:none}</style>
  3. <rect width="940" height="285" fill="#f8fafc"/><text x="34" y="34" class="t" font-weight="bold">连续相同的格子可以共用一张段卡:工作量从元素数转向段数</text>
  4. <text x="42" y="84" class="s">逐格数组</text>
  5. <g transform="translate(145 55)"><rect x="0" y="0" width="55" height="55" class="cell1"/><rect x="55" y="0" width="55" height="55" class="cell1"/><rect x="110" y="0" width="55" height="55" class="cell1"/><rect x="165" y="0" width="55" height="55" class="cell4"/><rect x="220" y="0" width="55" height="55" class="cell4"/><rect x="275" y="0" width="55" height="55" class="cell2"/><rect x="330" y="0" width="55" height="55" class="cell2"/><rect x="385" y="0" width="55" height="55" class="cell2"/><rect x="440" y="0" width="55" height="55" class="cell2"/>
  6. <g class="t" text-anchor="middle"><text x="27" y="34">1</text><text x="82" y="34">1</text><text x="137" y="34">1</text><text x="192" y="34">4</text><text x="247" y="34">4</text><text x="302" y="34">2</text><text x="357" y="34">2</text><text x="412" y="34">2</text><text x="467" y="34">2</text></g></g>
  7. <path d="M390 128 v38" class="a"/><path d="M390 166 l-9 -14 h18z" fill="#16a34a"/>
  8. <text x="42" y="204" class="s">ODT 段卡</text>
  9. <rect x="145" y="175" width="165" height="54" rx="8" class="card1"/><rect x="330" y="175" width="110" height="54" rx="8" class="card4"/><rect x="460" y="175" width="220" height="54" rx="8" class="card2"/>
  10. <g class="t" text-anchor="middle"><text x="227" y="207">[1,3,v=1]</text><text x="385" y="207">[4,5,v=4]</text><text x="570" y="207">[6,9,v=2]</text></g>
  11. <text x="705" y="204" class="s">9 个位置 → 3 张卡</text>
  12. </svg>