<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=10-%E6%90%9C%E7%B4%A2%2F01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2</id>
	<title>10-搜索/01-深度优先搜索 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=10-%E6%90%9C%E7%B4%A2%2F01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2"/>
	<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;action=history"/>
	<updated>2026-05-20T22:23:24Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=436&amp;oldid=prev</id>
		<title>33DAI：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=436&amp;oldid=prev"/>
		<updated>2026-05-20T18:24:03Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:24的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l81&quot;&gt;第81行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第81行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:搜索]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:搜索]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-403:rev-436:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=403&amp;oldid=prev</id>
		<title>33DAI：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=403&amp;oldid=prev"/>
		<updated>2026-05-20T18:12:20Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff:1.41:old-402:rev-403 --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=402&amp;oldid=prev</id>
		<title>-&gt;Importer：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=10-%E6%90%9C%E7%B4%A2/01-%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2&amp;diff=402&amp;oldid=prev"/>
		<updated>2026-05-20T16:50:33Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== 深度优先搜索（DFS） ==&lt;br /&gt;
&lt;br /&gt;
DFS 从起点出发，沿着一条路径&amp;#039;&amp;#039;&amp;#039;走到底&amp;#039;&amp;#039;&amp;#039;，再回溯尝试其他路径。核心思想是&amp;#039;&amp;#039;&amp;#039;递归&amp;#039;&amp;#039;&amp;#039;。&lt;br /&gt;
&lt;br /&gt;
=== 排列枚举 ===&lt;br /&gt;
&lt;br /&gt;
输出 &amp;lt;math&amp;gt;1 \sim n&amp;lt;/math&amp;gt; 的全排列：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int n, a[15];&lt;br /&gt;
bool used[15];&lt;br /&gt;
&lt;br /&gt;
void dfs(int step)&lt;br /&gt;
{&lt;br /&gt;
    if (step &amp;gt; n)&lt;br /&gt;
    {&lt;br /&gt;
        for (int i = 1; i &amp;lt;= n; i++)&lt;br /&gt;
            cout &amp;lt;&amp;lt; a[i] &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
        cout &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i = 1; i &amp;lt;= n; i++)&lt;br /&gt;
        if (!used[i])&lt;br /&gt;
        {&lt;br /&gt;
            used[i] = true;&lt;br /&gt;
            a[step] = i;&lt;br /&gt;
            dfs(step + 1);&lt;br /&gt;
            used[i] = false; // 回溯&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 组合枚举 ===&lt;br /&gt;
&lt;br /&gt;
从 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个中选 &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; 个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int n, m, a[15];&lt;br /&gt;
&lt;br /&gt;
void dfs(int step, int start)&lt;br /&gt;
{&lt;br /&gt;
    if (step &amp;gt; m)&lt;br /&gt;
    {&lt;br /&gt;
        for (int i = 1; i &amp;lt;= m; i++)&lt;br /&gt;
            cout &amp;lt;&amp;lt; a[i] &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
        cout &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i = start; i &amp;lt;= n; i++)&lt;br /&gt;
    {&lt;br /&gt;
        a[step] = i;&lt;br /&gt;
        dfs(step + 1, i + 1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 网格搜索 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int n, m;&lt;br /&gt;
char g[105][105];&lt;br /&gt;
bool vis[105][105];&lt;br /&gt;
int dx[] = {0, 0, 1, -1};&lt;br /&gt;
int dy[] = {1, -1, 0, 0};&lt;br /&gt;
&lt;br /&gt;
void dfs(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
    vis[x][y] = true;&lt;br /&gt;
    for (int i = 0; i &amp;lt; 4; i++)&lt;br /&gt;
    {&lt;br /&gt;
        int nx = x + dx[i];&lt;br /&gt;
        int ny = y + dy[i];&lt;br /&gt;
        if (nx &amp;lt; 1 || nx &amp;gt; n || ny &amp;lt; 1 || ny &amp;gt; m) continue;&lt;br /&gt;
        if (vis[nx][ny] || g[nx][ny] == &amp;#039;#&amp;#039;) continue;&lt;br /&gt;
        dfs(nx, ny);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:搜索]]&lt;br /&gt;
[[Category:三三文档]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>-&gt;Importer</name></author>
	</entry>
</feed>