You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
8.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<mxfile host="Electron" modified="2023-08-23T00:51:45.678Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.3.7 Chrome/112.0.5615.204 Electron/24.5.0 Safari/537.36" etag="smbT_BMNePP6TkLC_DvL" version="21.3.7" type="device">
<diagram id="K-rnQcr-T-lCCHxmAbID" name="第 1 页">
<mxGraphModel dx="1418" dy="838" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="cCYWK_54qTLuP-upu6Tg-1" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="70" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-2" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="130" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-3" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="190" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-4" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="250" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-5" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="310" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-6" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="370" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-7" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="430" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-8" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="490" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-9" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="550" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-10" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="610" y="60" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-11" value="x=3,找出连续3个空房间及以上的开始位置" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="155" y="20" width="490" height="30" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-13" value="tr[u].mx=3,tr[u].lx=0,tr[u].rx=1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="90" y="120" width="570" height="30" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-14" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="80" y="270" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-15" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="140" y="270" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-16" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="200" y="270" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-17" value="0" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="260" y="270" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-18" value="1" style="rounded=0;whiteSpace=wrap;html=1;fontSize=18;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="320" y="270" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-19" value="tr[u].mx=3,tr[u].lx=0,tr[u].rx=0" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;" parent="1" vertex="1">
<mxGeometry x="95" y="340" width="270" height="30" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-20" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;fontSize=18;entryX=0.644;entryY=0.011;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="240" y="210" as="sourcePoint" />
<mxPoint x="238.64" y="260.65999999999997" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-21" value="此时mid=1+5 &amp;gt;&amp;gt;1 =3:&lt;br&gt;&lt;br&gt;(1) tr[ls].mx=2&amp;nbsp;不够3个不能走这个分支&lt;br&gt;&lt;br&gt;(2) tr[ls].rx+tr[rs].lx=3&amp;nbsp;够了,走这个分支&amp;nbsp; =&amp;gt; return mid-tr[ls].rx+1,即可获得位置2这个分支不是递归而是实实在在的返回真实值&lt;br&gt;&lt;div style=&quot;&quot;&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;(3) tr[rs].mx&amp;gt;=x这个分支没机会走&lt;/span&gt;&lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="80" y="390" width="650" height="170" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-22" value="tr[ls].mx&amp;gt;=3由于想获取尽量小的左起点而左半边够用向左递归" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="85" y="170" width="570" height="30" as="geometry" />
</mxCell>
<mxCell id="cCYWK_54qTLuP-upu6Tg-23" value="&lt;font style=&quot;font-size: 27px;&quot;&gt;总结:&lt;br&gt;&lt;/font&gt;&lt;br&gt;1符合要求的状态共三种情况:&lt;br&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;① 左半部分存在大于等于x的空白房间&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;② 左半部分后面+右半部分前面存在大于等于x的空白房间&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;③ 右半部分存在大于等于x的空白房间&lt;br&gt;&lt;br&gt;这三种情依次讨论一遍,就可以求出最左侧的起点位置。&lt;br&gt;&lt;br&gt;2左半部分 或&amp;nbsp;右半部分中存在解,但无法确定具体位置,就还需要继续递归求解。&lt;br&gt;&lt;br&gt;3如果在中间部分存在解就可以直接找到起点。&lt;br&gt;&lt;br&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontColor=#FF0A2B;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="80" y="680" width="775" height="140" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>