锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久五月丁香综合中文亚洲,亚洲免费在线观看视频,中文字幕亚洲激情http://www.tkk7.com/fullfocus/category/30492.htmlzh-cnTue, 22 Apr 2008 20:50:14 GMTTue, 22 Apr 2008 20:50:14 GMT60(杞?鍒ゆ柇鏁扮粍涓厓绱犳槸鍚﹂噸澶?/title><link>http://www.tkk7.com/fullfocus/archive/2008/04/22/194901.html</link><dc:creator>fullfocus</dc:creator><author>fullfocus</author><pubDate>Tue, 22 Apr 2008 14:47:00 GMT</pubDate><guid>http://www.tkk7.com/fullfocus/archive/2008/04/22/194901.html</guid><wfw:comment>http://www.tkk7.com/fullfocus/comments/194901.html</wfw:comment><comments>http://www.tkk7.com/fullfocus/archive/2008/04/22/194901.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/fullfocus/comments/commentRss/194901.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/fullfocus/services/trackbacks/194901.html</trackback:ping><description><![CDATA[<br /> 闈㈣瘯鐨勫父鑰冮錛屽叧娉ㄧ畻娉曞鏉傚害鍜岀┖闂達紝 <br /> <br /> 鍋囧鏄笅闈㈢殑鏂規硶鍒ゆ柇鏄惁鏈夐噸澶?<br /> int a[MAX] = {0}; <br /> unsigned int x; <br /> for(int i=0;i <n;i++) <br /> { <br />    //璇誨叆x <br />    if(a[x]==1) <br />    { <br />        //x閲嶅鍑虹幇浜?<br />    } <br />    else <br />    { <br />        a[x]=1; <br />    } <br /> } <br /> <br /> 閭d箞錛孧AX姣旇緝澶ф椂灝變笉鍚堥備簡 <br /> 浣嗘槸鍙互鎶?#8220;鐢╥nt鏁扮粍璁板綍鏄惁閲嶅”鏀逛負“鐢ㄦ瘡涓涓猙it璁板綍鏄惁閲嶅”錛屼簬鏄彉鎴愶細 <br /> int a[MAX] = {0}; <br /> unsigned int x; <br /> const int iBitCount = 32; <br /> for(int i=0;i <n;i++) <br /> { <br />    //璇誨叆x <br />    if(a[x/iBitCount]& (1 < <(x%iBitCount))!=0) <br />    { <br />        //x閲嶅鍑虹幇浜?<br />    } <br />    else <br />    { <br />        a[x/iBitCount] ¦= (1 < <(x%iBitCount)); <br />    } <br /> } <br /> <br /> 鍙︽湁錛屽師鍦版帓搴忕瓑O(1)錛屾帓搴忓悗闄ら噸絳?br /> <br /> <br /> <img src ="http://www.tkk7.com/fullfocus/aggbug/194901.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/fullfocus/" target="_blank">fullfocus</a> 2008-04-22 22:47 <a href="http://www.tkk7.com/fullfocus/archive/2008/04/22/194901.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>8鐨囧悗闂錛嶅洖婧?/title><link>http://www.tkk7.com/fullfocus/archive/2008/04/12/192484.html</link><dc:creator>fullfocus</dc:creator><author>fullfocus</author><pubDate>Sat, 12 Apr 2008 15:39:00 GMT</pubDate><guid>http://www.tkk7.com/fullfocus/archive/2008/04/12/192484.html</guid><wfw:comment>http://www.tkk7.com/fullfocus/comments/192484.html</wfw:comment><comments>http://www.tkk7.com/fullfocus/archive/2008/04/12/192484.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/fullfocus/comments/commentRss/192484.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/fullfocus/services/trackbacks/192484.html</trackback:ping><description><![CDATA[<br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000;">#include </span><span style="color: #000000;"><</span><span style="color: #000000;">stdio.h</span><span style="color: #000000;">></span><span style="color: #000000;"><br /> #include </span><span style="color: #000000;"><</span><span style="color: #000000;">stdlib.h</span><span style="color: #000000;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">void</span><span style="color: #000000;">  eightQueen(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">**</span><span style="color: #000000;"> board, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> n, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> m);<br /> </span><span style="color: #008000;">/*</span><span style="color: #008000;">if valid, return 1</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> isValid(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">**</span><span style="color: #000000;">  board,</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> n, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> m, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> j);<br /> <br /> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main()<br /> {<br />     </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> </span><span style="color: #000000;">**</span><span style="color: #000000;">board </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> </span><span style="color: #000000;">**</span><span style="color: #000000;">)malloc(sizeof(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> </span><span style="color: #000000;">*</span><span style="color: #000000;">)</span><span style="color: #000000;">*</span><span style="color: #000000;">4</span><span style="color: #000000;">);<br />     </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">, j</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(;i</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">; i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />     {<br />         board[i] </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> </span><span style="color: #000000;">*</span><span style="color: #000000;">) malloc(sizeof(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">) </span><span style="color: #000000;">*</span><span style="color: #000000;"> </span><span style="color: #000000;">4</span><span style="color: #000000;">);<br />     }<br />      i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />      j </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(;i</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">; i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(; j </span><span style="color: #000000;"><</span><span style="color: #000000;"> </span><span style="color: #000000;">4</span><span style="color: #000000;">; j</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />         {<br />             board[i][j] </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />         }    <br />     eightQueen(board, </span><span style="color: #000000;">4</span><span style="color: #000000;">,</span><span style="color: #000000;">4</span><span style="color: #000000;">);<br />     <br />      i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">, j </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />      </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(; i</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">; i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />      {<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(; j </span><span style="color: #000000;"><</span><span style="color: #000000;"> </span><span style="color: #000000;">4</span><span style="color: #000000;">; j</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />         {<br />             printf(</span><span style="color: #000000;">"</span><span style="color: #000000;">%d(%d) </span><span style="color: #000000;">"</span><span style="color: #000000;">,board[i][j], i);<br />             <br />         }    <br />     }<br />         <br />     </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br /> }<br /> <br /> <br /> </span><span style="color: #0000ff;">void</span><span style="color: #000000;">  eightQueen(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">**</span><span style="color: #000000;"> board, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> n, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> m)<br /> {    </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> ii </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> jj </span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> k </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">while</span><span style="color: #000000;">(ii </span><span style="color: #000000;"><</span><span style="color: #000000;"> n </span><span style="color: #000000;">&&</span><span style="color: #000000;"> ii </span><span style="color: #000000;">>=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)<br />     {<br />     <br />         <br />         jj </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />         </span><span style="color: #0000ff;">while</span><span style="color: #000000;">( jj</span><span style="color: #000000;"><</span><span style="color: #000000;">m)<br />         {<br />             </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(board[ii][jj] </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;"> </span><span style="color: #000000;">&&</span><span style="color: #000000;"> jj</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;"> </span><span style="color: #000000;"><</span><span style="color: #000000;"> m)<br />             {<br />                 board[ii][jj] </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />                 board[ii][</span><span style="color: #000000;">++</span><span style="color: #000000;">jj] </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">;<br />             }<br />             </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br />                 board[ii][jj] </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">;<br />             <br />             </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(isValid(board, n,m,ii,jj))<br />             {<br />                 </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(ii </span><span style="color: #000000;">==</span><span style="color: #000000;"> n</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">) </span><span style="color: #0000ff;">return</span><span style="color: #000000;">;<br />             }<br />              </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br />              {<br />                  ii</span><span style="color: #000000;">++</span><span style="color: #000000;">;<br />                    </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;<br />               }    <br />               jj</span><span style="color: #000000;">++</span><span style="color: #000000;">;<br />         }<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(jj</span><span style="color: #000000;">>=</span><span style="color: #000000;">m)<br />         {<br />             board[ii][jj</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">] </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />             ii</span><span style="color: #000000;">--</span><span style="color: #000000;">;<br />         }<br />         <br />     }<br />     <br /> }<br /> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> isValid(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">**</span><span style="color: #000000;"> board,</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> n, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> m, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i, </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> j)<br /> {<br />     </span><span style="color: #008000;">//</span><span style="color: #008000;">鍒ゆ柇鏄惁鍚屽垪</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">    </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> temp </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(; temp </span><span style="color: #000000;"><</span><span style="color: #000000;"> n; temp</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />     {<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(temp </span><span style="color: #000000;">!=</span><span style="color: #000000;"> i)<br />         {<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(board[temp][j] </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)<br />             </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />         }<br />             <br />     }<br />     </span><span style="color: #008000;">//</span><span style="color: #008000;">鍒ゆ柇鏄惁鍙充笂瑙?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">    </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> ii, jj;<br />     </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(ii </span><span style="color: #000000;">=</span><span style="color: #000000;">i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">, jj</span><span style="color: #000000;">=</span><span style="color: #000000;">j</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">; ii </span><span style="color: #000000;">>=</span><span style="color: #000000;">0</span><span style="color: #000000;">&&</span><span style="color: #000000;">jj </span><span style="color: #000000;"><=</span><span style="color: #000000;"> m; ii</span><span style="color: #000000;">--</span><span style="color: #000000;">,jj</span><span style="color: #000000;">++</span><span style="color: #000000;">)</span><span style="color: #008000;">//</span><span style="color: #008000;">娉ㄦ剰涓棿鍒ゆ柇鏉′歡鐨?amp;&</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">    {<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(board[ii][jj] </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)<br />             </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     }<br />     </span><span style="color: #008000;">//</span><span style="color: #008000;">鍒ゆ柇鏄惁宸︿笂瑙?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">    </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(ii </span><span style="color: #000000;">=</span><span style="color: #000000;">i</span><span style="color: #000000;">-</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">,jj</span><span style="color: #000000;">=</span><span style="color: #000000;">j</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">; ii </span><span style="color: #000000;">>=</span><span style="color: #000000;">0</span><span style="color: #000000;">&&</span><span style="color: #000000;">jj </span><span style="color: #000000;">>=</span><span style="color: #000000;">0</span><span style="color: #000000;">;ii</span><span style="color: #000000;">--</span><span style="color: #000000;">,jj</span><span style="color: #000000;">--</span><span style="color: #000000;">)<br />     {<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(board[ii][jj] </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)<br />             </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br />     }<br />     </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">;<br /> <br />     <br /> }<br /> </span></div> <br /> <br /> <br /> <br /> <img src ="http://www.tkk7.com/fullfocus/aggbug/192484.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/fullfocus/" target="_blank">fullfocus</a> 2008-04-12 23:39 <a href="http://www.tkk7.com/fullfocus/archive/2008/04/12/192484.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈闀垮叕鍏卞瓙搴忓垪闂錛峜瀹炵幇http://www.tkk7.com/fullfocus/archive/2008/04/06/191124.htmlfullfocusfullfocusSun, 06 Apr 2008 14:51:00 GMThttp://www.tkk7.com/fullfocus/archive/2008/04/06/191124.htmlhttp://www.tkk7.com/fullfocus/comments/191124.htmlhttp://www.tkk7.com/fullfocus/archive/2008/04/06/191124.html#Feedback0http://www.tkk7.com/fullfocus/comments/commentRss/191124.htmlhttp://www.tkk7.com/fullfocus/services/trackbacks/191124.html鍏抽敭鐐癸細
1.鎵懼嚭闂鐨勯掑綊琛ㄨ揪寮?
2.鐒跺悗鏍規嵁琛ㄨ揪寮忥紝鐩存帴杞寲涓虹煩闃典笂鐨勬暟鎹繍綆?

鏈棶棰樼殑閫掑綊琛ㄨ揪寮忎負錛?
L錛籭,j錛界瓑浜?0 ifi錛? 鎴栬?j錛?
絳変簬L錛籭-1,j-1錛斤紜1 ifi>0 ,j>0 ai = bi
絳変簬 max锝汱錛籭,j-1錛? L錛籭-1,j錛斤綕 if i > 0 j>0, ai != bj  闃呰鍏ㄦ枃

fullfocus 2008-04-06 22:51 鍙戣〃璇勮
]]>
[閫掑綊鍜岄摼琛ㄦā鎷焆鍒犻櫎涓涓潪絀虹洰褰曪紝騫舵樉紺烘墍鏈夎鍒犻櫎鐨勬枃浠跺拰鐩綍鍒楄〃http://www.tkk7.com/fullfocus/archive/2008/03/30/189684.htmlfullfocusfullfocusSun, 30 Mar 2008 15:21:00 GMThttp://www.tkk7.com/fullfocus/archive/2008/03/30/189684.htmlhttp://www.tkk7.com/fullfocus/comments/189684.htmlhttp://www.tkk7.com/fullfocus/archive/2008/03/30/189684.html#Feedback0http://www.tkk7.com/fullfocus/comments/commentRss/189684.htmlhttp://www.tkk7.com/fullfocus/services/trackbacks/189684.html絎竴涓槸閫掑綊紼嬪簭錛岀浜屼釜鐢ㄤ竴涓狶inkedList妯℃嫙瀹炵幇錛岋紙java錛?nbsp; 闃呰鍏ㄦ枃

fullfocus 2008-03-30 23:21 鍙戣〃璇勮
]]>
姹傚鏁板厓绱?/title><link>http://www.tkk7.com/fullfocus/archive/2008/03/29/189544.html</link><dc:creator>fullfocus</dc:creator><author>fullfocus</author><pubDate>Sat, 29 Mar 2008 15:03:00 GMT</pubDate><guid>http://www.tkk7.com/fullfocus/archive/2008/03/29/189544.html</guid><wfw:comment>http://www.tkk7.com/fullfocus/comments/189544.html</wfw:comment><comments>http://www.tkk7.com/fullfocus/archive/2008/03/29/189544.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/fullfocus/comments/commentRss/189544.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/fullfocus/services/trackbacks/189544.html</trackback:ping><description><![CDATA[鐢ㄩ掑綊娉?灝鵑掑綊)姹傛渶澶氬厓绱?鍗蟲壘鍑哄嚭鐜版鏁板ぇ浜巒/2鐨勫厓绱?br /> 鍩轟簬鍘熺悊:鍘繪帀涓や釜涓嶅悓鐨勫厓绱?鍓╀笅鏁扮粍閲岀殑鏈澶氬厓绱犱粛鐒舵槸鏁翠釜鏁扮粍鐨勬渶澶氬厓绱?濡傛灉瀛樺湪鐨勮瘽)<br /> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">#include </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">stdio.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> majority(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> [], </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> );<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main()<br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">{<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> c </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> data [] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> {</span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">};<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> maj </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> majority(data,</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> ,</span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">);<br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">( ; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">    {<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(maj </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> data[i])<br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">           c</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">    }    <br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">    printf(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">The majority num of this array is: %d\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, c</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">maj:</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">);<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">}<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">s for the begining index, and e for the ending index<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 128, 0);">* * find the cadidate num of majority</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> majority(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> data[], </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> s, </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> e)</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">begin s = 1, e = n(including)</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">{<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> c </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> count the candidate majority num</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j; </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">fot the index move on</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">( j </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> s; j</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> e; j</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);">    {<br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( data[s</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">] </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> data[j])<br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);">            c</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);">        {<br /> </span><span style="color: rgb(0, 128, 128);">31</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">--</span><span style="color: rgb(0, 0, 0);">c</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 128, 128);">32</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);">;    <br /> </span><span style="color: rgb(0, 128, 128);">33</span> <span style="color: rgb(0, 0, 0);">        }        <br /> </span><span style="color: rgb(0, 128, 128);">34</span> <span style="color: rgb(0, 0, 0);">    }    <br /> </span><span style="color: rgb(0, 128, 128);">35</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(c</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 128, 128);">36</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> data[s</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br /> </span><span style="color: rgb(0, 128, 128);">37</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">38</span> <span style="color: rgb(0, 0, 0);">         majority(data, j</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">, e);<br /> </span><span style="color: rgb(0, 128, 128);">39</span> <span style="color: rgb(0, 0, 0);">            <br /> </span><span style="color: rgb(0, 128, 128);">40</span> <span style="color: rgb(0, 0, 0);">}</span> </div> <br /> <br /> <img src ="http://www.tkk7.com/fullfocus/aggbug/189544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/fullfocus/" target="_blank">fullfocus</a> 2008-03-29 23:03 <a href="http://www.tkk7.com/fullfocus/archive/2008/03/29/189544.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>絎竴嬈″啓榪欎箞澶氫唬鐮乢!!--綰痗鍝堝か鏇間唬鐮佸疄鐜幫紙鐢ㄤ簡鏈灝忓爢錛?/title><link>http://www.tkk7.com/fullfocus/archive/2008/03/28/189375.html</link><dc:creator>fullfocus</dc:creator><author>fullfocus</author><pubDate>Fri, 28 Mar 2008 15:29:00 GMT</pubDate><guid>http://www.tkk7.com/fullfocus/archive/2008/03/28/189375.html</guid><wfw:comment>http://www.tkk7.com/fullfocus/comments/189375.html</wfw:comment><comments>http://www.tkk7.com/fullfocus/archive/2008/03/28/189375.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.tkk7.com/fullfocus/comments/commentRss/189375.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/fullfocus/services/trackbacks/189375.html</trackback:ping><description><![CDATA[     鎽樿: 浠ュ墠閮芥槸鍦ㄤ竴涓枃浠墮噷鍐欎唬鐮佺殑錛岀涓嬈$敤浜嗚繖涔堝鏂囦歡錛?涓猒!!錛夛紝鍝堬紝寰堟湁鎴愬氨鎰熼樋錛岃繕鐔熸倝浜唋inux涓嬬殑緙栫▼鐜錛実cc,gdb閮芥槸寰堝ソ濂藉己澶х殑涓滀笢錛岃寰椾笅嬈″鐢ㄧ敤錛?鏈変笉瓚充箣澶勬湜鍚勪綅楂樻墜鎸囨闃匡紒錛侊紒 huffman.h Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.Code...  <a href='http://www.tkk7.com/fullfocus/archive/2008/03/28/189375.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/fullfocus/aggbug/189375.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/fullfocus/" target="_blank">fullfocus</a> 2008-03-28 23:29 <a href="http://www.tkk7.com/fullfocus/archive/2008/03/28/189375.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://maomaots.com" target="_blank">亚洲天堂久久精品</a>| <a href="http://5c7m.com" target="_blank">亚洲日韩欧洲无码av夜夜摸</a>| <a href="http://changfafangzhi.com" target="_blank">亚洲国产精品自在在线观看</a>| <a href="http://kimnote.com" target="_blank">久草免费福利在线</a>| <a href="http://xa69.com" target="_blank">亚洲人成电影网站国产精品</a>| <a href="http://ajguild.com" target="_blank">日本永久免费a∨在线视频</a>| <a href="http://webgame86.com" target="_blank">啦啦啦www免费视频</a>| <a href="http://bx85.com" target="_blank">三年片免费高清版 </a>| <a href="http://wwwk47.com" target="_blank">一级毛片免费播放试看60分钟</a>| <a href="http://350725.com" target="_blank">免费无码又爽又刺激毛片</a>| <a href="http://ybcin.com" target="_blank">亚洲日韩精品国产3区</a>| <a href="http://c4665.com" target="_blank">女人张腿给男人桶视频免费版</a>| <a href="http://bjfljg.com" target="_blank">亚洲日产乱码一二三区别</a>| <a href="http://djyvp32.com" target="_blank">免费无码一区二区三区蜜桃大</a>| <a href="http://ncmyw.com" target="_blank">香蕉视频亚洲一级</a>| <a href="http://goodwaysi.com" target="_blank">亚洲一区二区三区无码影院</a>| <a href="http://ivr69.com" target="_blank">全黄大全大色全免费大片</a>| <a href="http://yhanalati.com" target="_blank">国产亚洲精品美女久久久 </a>| <a href="http://zhhy68.com" target="_blank">免费无码肉片在线观看</a>| <a href="http://xcdys.com" target="_blank">亚洲色偷偷偷综合网</a>| <a href="http://av-fantasy.com" target="_blank">国产成人免费ā片在线观看</a>| <a href="http://tpwelert.com" target="_blank">男女污污污超污视频免费在线看</a>| <a href="http://shmtweld.com" target="_blank">亚洲天堂在线视频</a>| <a href="http://yw323.com" target="_blank">日韩免费人妻AV无码专区蜜桃</a>| <a href="http://czhos.com" target="_blank">亚洲人成综合在线播放</a>| <a href="http://89895cc.com" target="_blank">日韩在线免费播放</a>| <a href="http://yuanzhouxh.com" target="_blank">久久国产福利免费</a>| <a href="http://assbjg.com" target="_blank">亚洲免费观看网站</a>| <a href="http://yuanzhouxh.com" target="_blank">免费中文字幕不卡视频</a>| <a href="http://bxd888.com" target="_blank">免费观看在线禁片</a>| <a href="http://tha2008.com" target="_blank">亚洲中文字幕AV在天堂</a>| <a href="http://www676617.com" target="_blank">亚洲国产综合人成综合网站</a>| <a href="http://ur5r2kr.com" target="_blank">久久成人免费播放网站</a>| <a href="http://bdykdq.com" target="_blank">亚洲中文字幕久久无码</a>| <a href="http://zjdoukai.com" target="_blank">亚洲综合久久夜AV </a>| <a href="http://139699.com" target="_blank">777爽死你无码免费看一二区</a>| <a href="http://gnebs.com" target="_blank">亚洲日韩精品无码专区加勒比</a>| <a href="http://czshenyue.com" target="_blank">中文字幕无码精品亚洲资源网</a>| <a href="http://myzhoubian.com" target="_blank">亚洲免费中文字幕</a>| <a href="http://smalody.com" target="_blank">成人午夜免费视频</a>| <a href="http://bjtjchem.com" target="_blank">91亚洲国产成人久久精品</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>