<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" version="2.0"><channel><atom:link href="http://feed.feedsky.com/fayaacomments" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/fayaacomments" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 21 May 2012 13:51:28 GMT</lastBuildDate><title>代码发芽网最新评论</title><description>来自代码发芽网(http://www.fayaa.com/code/)的最新评论</description><link>http://fayaa.com/code/feeds/comments/</link><language>zh-cn</language><pubDate>Mon, 21 May 2012 08:51:38 GMT</pubDate><item><title>Codee#26210</title><link>http://fayaa.com/code/view/26210/#cmt762</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/10260/&quot;&gt;Devin&lt;/a&gt; 在 21天前 说:&lt;/em&gt;
&lt;br /&gt;
这和Codee#26210 
&lt;br /&gt;一模一样，建议删除。 &lt;img src=&quot;/static/images/smiley/!.gif&quot; /&gt; 
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390544/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/26210/#cmt762&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/26210/#cmt762</guid><fs:srclink>http://fayaa.com/code/view/26210/#cmt762</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390544/5183096</fs:itemid></item><item><title>Joseph Problem</title><link>http://fayaa.com/code/view/26213/#cmt761</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/607/&quot;&gt;leaveye&lt;/a&gt; 在 24天前 说:&lt;/em&gt;
&lt;br /&gt;
中文字...
&lt;br /&gt;
&lt;br /&gt;/tmp$ gcc -Wall -o joseph joseph.c 
&lt;br /&gt;
&lt;br /&gt;/tmp$ ./joseph 10 5
&lt;br /&gt;Got N=10, M=5
&lt;br /&gt;Array: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. total 10 elems
&lt;br /&gt;Array: 4, 9, 5, 1, 8, 7, 0, 3, 6, 2. total 10 elems
&lt;br /&gt;
&lt;br /&gt;/tmp$ ./joseph 10 1
&lt;br /&gt;Got N=10, M=1
&lt;br /&gt;Array: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. total 10 elems
&lt;br /&gt;Array: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. total 10 elems
&lt;br /&gt;
&lt;br /&gt;/tmp$ ./joseph 10 2
&lt;br /&gt;Got N=10, M=2
&lt;br /&gt;Array: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. total 10 elems
&lt;br /&gt;Array: 1, 3, 5, 7, 9, 2, 6, 0, 8, 4. total 10 elems
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390545/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/26213/#cmt761&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/26213/#cmt761</guid><fs:srclink>http://fayaa.com/code/view/26213/#cmt761</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390545/5183096</fs:itemid></item><item><title>Codee#26167</title><link>http://fayaa.com/code/view/26167/#cmt760</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/8831/&quot;&gt;invalid_user&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
识别一下stl的关键字 好么？
&lt;br /&gt;这样着色跟没着色是一样的哇 &lt;img src=&quot;/static/images/smiley/h.gif&quot; /&gt; 
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390546/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/26167/#cmt760&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/26167/#cmt760</guid><fs:srclink>http://fayaa.com/code/view/26167/#cmt760</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390546/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt759</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9916/&quot;&gt;lazycat007&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
其实是代码写得太烂，不好意思往上发。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390547/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt759&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt759</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt759</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390547/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt758</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9916/&quot;&gt;lazycat007&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
@njuaplusplus: 请仔细看105~120行的代码。并请仔细检查得出的结果。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390548/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt758&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt758</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt758</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390548/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt757</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9916/&quot;&gt;lazycat007&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
其中需要注意的是，如果是9区块，可以按照普通数独的方法设置，将9个候选数都设置进去即可。并且在行头上记录该行是哪些位置上有哪些候选数。在解题时，每选择一行，就记录该行对应的位置和候选数。
&lt;br /&gt;因为代码太多，就不往上发了。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390549/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt757&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt757</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt757</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390549/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt756</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9916/&quot;&gt;lazycat007&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
给出其中的关键部分，供大家参考。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390550/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt756&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt756</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt756</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390550/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt755</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9916/&quot;&gt;lazycat007&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
@njuaplusplus: 你说的这个问题应该不存在，本身算法就是可回溯的，必须要在函数返回后，将删除的结点进行恢复。因为函数在挑选列时，每次只找一个CNT最少的列，然后对这一列进行循环，所以每次函数返回，就会选择该列的下一个结点，也即下一种可能，因此不会有重复。现在这段代码只能显示2个解，需要稍微修改下，才能显示更多的解。
&lt;br /&gt;
&lt;br /&gt;关于杀手数独，需要重新定义行，将每个区块的所有可能列出，然后再进行全排列，每个排列作为一行，列的设置不变。每行是这个区块的一个固定解（位置固定，候选数固定），这样就可以解杀手数独了。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390551/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt755&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt755</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt755</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390551/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt754</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9650/&quot;&gt;njuaplusplus&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
@lazycat007: 请问你是怎么用这个来改杀手数独的呢~
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390552/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt754&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt754</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt754</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390552/5183096</fs:itemid></item><item><title>目前最快的数独求解程序 - 实现了Knuth的Dancing Links+Algorithm X算法</title><link>http://fayaa.com/code/view/1738/#cmt753</link><description>&lt;code&gt;
&lt;em&gt;&lt;a href=&quot;/code/user/9650/&quot;&gt;njuaplusplus&lt;/a&gt; 在 1个月前 说:&lt;/em&gt;
&lt;br /&gt;
@半瓶墨水: 不好意思。。之前在赶作业。。所以没有回复。。这个回复好像没有提醒功能呢~
&lt;br /&gt;没有过分测试，只是发现，可能程序无限递归回溯然后再递归，因为你测试之后将删除的结点全部放回了。。。目前猜测可能是这边的问题。。
&lt;br /&gt;这样讲不清楚。。
&lt;br /&gt;举个例子吧：
&lt;br /&gt;你去掉那个scnt&amp;gt;2，就是说我这里有个数独其存在多个不同的解，我想将这些解全部求出来，那么可能会一直进入上述状态，只重复找到多个解中的同一个解。。
&lt;br /&gt;你可以用个空的数独，即81个&quot;.&quot;来测个20个解，打印出来，发现都是一样的。。
&lt;/code&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/638390553/fayaacomments/feedsky/s.gif?r=http://fayaa.com/code/view/1738/#cmt753&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><pubDate>Mon, 21 May 2012 21:51:28 +0800</pubDate><guid isPermaLink="false">http://fayaa.com/code/view/1738/#cmt753</guid><fs:srclink>http://fayaa.com/code/view/1738/#cmt753</fs:srclink><fs:srcfeed>http://www.fayaa.com/code/feeds/comments/</fs:srcfeed><fs:itemid>feedsky/fayaacomments/~7074795/638390553/5183096</fs:itemid></item></channel></rss>
