锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩精品久久久久久,亚洲国产精品无码久久久秋霞2,久久国产精品一区http://www.shnenglu.com/hoolee/category/19707.htmlIf you believe, you can!zh-cnSat, 04 May 2013 13:23:10 GMTSat, 04 May 2013 13:23:10 GMT60涓閬撳熀紜鐨勭嚎孌墊爲棰樸?/title><link>http://www.shnenglu.com/hoolee/archive/2013/04/28/199806.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Sun, 28 Apr 2013 10:47:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2013/04/28/199806.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/199806.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2013/04/28/199806.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/199806.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/199806.html</trackback:ping><description><![CDATA[     鎽樿: 鏈澶у?TimeLimit: 1000MS  MemoryLimit: 65536 Kb Totalsubmit: 161   Accepted: 4   Description Little Ming寰堝枩嬈㈣緇冭嚜宸辯殑蹇熻鑳藉姏錛屼粬鏈榪戞壘鍒頒竴縐嶆柊鐨勮冮獙騫惰緇冨揩閫熻鑳藉姏鐨勬柟娉曪紝鍦ㄤ竴琛屽叿...  <a href='http://www.shnenglu.com/hoolee/archive/2013/04/28/199806.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/hoolee/aggbug/199806.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2013-04-28 18:47 <a href="http://www.shnenglu.com/hoolee/archive/2013/04/28/199806.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>zoj1101--浜屽垎鏌ユ壘鐨勫簲鐢?/title><link>http://www.shnenglu.com/hoolee/archive/2012/08/01/185938.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Wed, 01 Aug 2012 13:39:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2012/08/01/185938.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/185938.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2012/08/01/185938.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/185938.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/185938.html</trackback:ping><description><![CDATA[<div>浜屽垎鏌ユ壘錛屾槸涓縐嶉拡瀵規(guī)湁搴忓簭鍒楃殑鏌ユ壘鏂瑰紡錛屾瘡嬈¤凱浠d細緙╁皬涓鍗婄殑鏌ユ壘鑼冨洿錛屼竴嬈℃煡鎵劇殑鏃墮棿澶嶆潅搴︿負O(logN)銆?br />綆鍗曡涓涓嬩簩鍒嗘煡鎵捐繃紼嬶細鍦ㄦ湁搴忓簭鍒梥eq[]涓壘涓涓暟n錛屽亣璁捐繖涓簭鍒楃殑璧峰涓嬫爣鍒嗗埆涓篴錛宐錛宮id=(a+b)/2錛岄偅涔坣瑕佷箞灝辨槸seq[mid]錛坣=seq[mid]錛夛紝瑕佷箞鍦╩id宸﹁竟錛坣<seq[mid]錛夛紝瑕佷箞鍦╩id鍙寵竟錛坣>seq[mid]錛夛紝瑕佷箞榪欎釜鏁版牴鏈笉鍦╯eq[]涓?br /><br />涓嬮潰榪欓亾棰樻槸浜屽垎鏌ユ壘鐨勫吀鍨嬪簲鐢細<br />zoj1101<br />棰樻剰鎻忚堪錛氬湪緇欏畾鏁存暟搴忓垪錛?lt;=1000錛変腑鎵懼嚭鍥涗釜涓嶅悓鐨勬暟錛屼嬌寰椾笁涓暟鐨勫拰絳変簬鍙﹀涓涓暟銆?br />鐩存帴鐢ㄥ洓灞傚驚鐜搧瀹氳秴鏃訛紝榪欓噷閲囩敤浜嗕竴縐嶆嬁絀洪棿鎹㈡椂闂寸殑鏂瑰紡銆?br />鍋囪鏈塧+b+d=c錛岃繖絳変環(huán)浜巃+b=c-d錛屾垜浠彲浠ユ妸鎵鏈夌殑a+b瀛樿搗鏉ワ紙<=10^6涓級錛屾妸鎵鏈夌殑c-d涔熷瓨璧鋒潵錛?lt;=10^6涓級錛屽綋鎷垮埌姣忎竴涓猘+b鏃舵垜浠彧闇瑕佸湪鎵鏈塩-d鐨勫簭鍒椾腑鏌ユ壘灝辮浜嗐傚厛鎶奵-d搴忓垪鎺掑簭錛屾帓搴忔椂闂村鏉傚害O(NlogN)錛屾煡鎵捐繃紼嬪彲浠ョ敤浜屽垎錛岃繖鏍峰氨涓嶄細瓚呮椂鍟︺?br />浠ヤ笅鏄湰棰樹唬鐮侊細<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><img id="Code_Closed_Image_213855" onclick="this.style.display='none'; Code_Closed_Text_213855.style.display='none'; Code_Open_Image_213855.style.display='inline'; Code_Open_Text_213855.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_213855" style="display: none" onclick="this.style.display='none'; Code_Open_Text_213855.style.display='none'; Code_Closed_Image_213855.style.display='inline'; Code_Closed_Text_213855.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11"><span id="Code_Closed_Text_213855" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"></span><span id="Code_Open_Text_213855" style="display: none"><br /><!--<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; ">#define</span><span style="color: #000000; "> MAX 2100000000</span><span style="color: #000000; "><br /></span><span style="color: #0000FF; ">#define</span><span style="color: #000000; "> LEN 1000010</span><span style="color: #000000; "><br /></span><span style="color: #0000FF; ">#define</span><span style="color: #000000; "> LEN1 1010</span><span style="color: #000000; "><br />typedef </span><span style="color: #0000FF; ">struct</span><span style="color: #000000; "> <br />{<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> rs;<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> a;<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> b;<br />}Node;<br />Node addseq[LEN];<br />Node subseq[LEN];<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> num[LEN1];<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> seqlen;<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> wagamount;<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> binSch(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> n, </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> bg, </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> ed)</span><span style="color: #008000; ">//</span><span style="color: #008000; ">浜屽垎鏌ユ壘——閫掑綊鏂瑰紡</span><span style="color: #008000; "><br /></span><span style="color: #000000; ">{<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(bg </span><span style="color: #000000; ">></span><span style="color: #000000; "> ed)<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #000000; ">-</span><span style="color: #000000; ">1</span><span style="color: #000000; ">;<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(bg </span><span style="color: #000000; ">==</span><span style="color: #000000; "> ed)<br />    {<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; ">==</span><span style="color: #000000; "> subseq[bg].rs)<br />            </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> bg;<br />        </span><span style="color: #0000FF; ">return</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; ">int</span><span style="color: #000000; "> mid </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (bg </span><span style="color: #000000; ">+</span><span style="color: #000000; "> ed) </span><span style="color: #000000; ">/</span><span style="color: #000000; "> </span><span style="color: #000000; ">2</span><span style="color: #000000; ">;<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; ">==</span><span style="color: #000000; "> subseq[mid].rs)<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> mid;<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; "><</span><span style="color: #000000; "> subseq[mid].rs)<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> binSch(n, bg, mid </span><span style="color: #000000; ">-</span><span style="color: #000000; "> </span><span style="color: #000000; ">1</span><span style="color: #000000; ">);<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; ">></span><span style="color: #000000; "> subseq[mid].rs)<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> binSch(n, mid </span><span style="color: #000000; ">+</span><span style="color: #000000; "> </span><span style="color: #000000; ">1</span><span style="color: #000000; ">, ed);<br />}<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> binSch2(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> n, </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> bg, </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> ed)</span><span style="color: #008000; ">//</span><span style="color: #008000; ">浜屽垎鏌ユ壘——闈為掑綊鏂瑰紡</span><span style="color: #008000; "><br /></span><span style="color: #000000; ">{<br />    </span><span style="color: #0000FF; ">while</span><span style="color: #000000; ">(bg </span><span style="color: #000000; "><=</span><span style="color: #000000; "> ed)<br />    {<br />        </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> mid </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (bg </span><span style="color: #000000; ">+</span><span style="color: #000000; "> ed) </span><span style="color: #000000; ">/</span><span style="color: #000000; "> </span><span style="color: #000000; ">2</span><span style="color: #000000; ">;<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; ">==</span><span style="color: #000000; "> subseq[mid].rs)<br />            </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> mid;<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(n </span><span style="color: #000000; "><</span><span style="color: #000000; "> subseq[mid].rs)<br />            ed </span><span style="color: #000000; ">=</span><span style="color: #000000; "> mid </span><span style="color: #000000; ">-</span><span style="color: #000000; "> </span><span style="color: #000000; ">1</span><span style="color: #000000; ">;<br />        </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> <br />            bg </span><span style="color: #000000; ">=</span><span style="color: #000000; "> mid </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; ">return</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; ">int</span><span style="color: #000000; "> findWinner()<br />{<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> i, j;<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> n;<br />    </span><span style="color: #0000FF; ">for</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; ">; i </span><span style="color: #000000; "><</span><span style="color: #000000; "> seqlen; i</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)<br />    {<br />        n </span><span style="color: #000000; ">=</span><span style="color: #000000; "> addseq[i].rs;<br />        </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> a </span><span style="color: #000000; ">=</span><span style="color: #000000; "> addseq[i].a;<br />        </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> b </span><span style="color: #000000; ">=</span><span style="color: #000000; "> addseq[i].b;<br />        </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> find </span><span style="color: #000000; ">=</span><span style="color: #000000; "> binSch(n, </span><span style="color: #000000; ">0</span><span style="color: #000000; ">, seqlen </span><span style="color: #000000; ">-</span><span style="color: #000000; "> </span><span style="color: #000000; ">1</span><span style="color: #000000; ">);<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(find </span><span style="color: #000000; ">!=</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; ">int</span><span style="color: #000000; "> c </span><span style="color: #000000; ">=</span><span style="color: #000000; "> subseq[find].a;<br />            </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> d </span><span style="color: #000000; ">=</span><span style="color: #000000; "> subseq[find].b;<br />            </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(a </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> b </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> a </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> c </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> a </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> d </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> b </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> c </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> b </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> d </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> c </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> d)<br />            {<br />                </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(c </span><span style="color: #000000; ">></span><span style="color: #000000; "> wagamount)<br />                    wagamount </span><span style="color: #000000; ">=</span><span style="color: #000000; "> c;<br />            }<br />        }<br />    }<br />}<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> cmp(</span><span style="color: #0000FF; ">const</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> </span><span style="color: #000000; ">*</span><span style="color: #000000; ">a, </span><span style="color: #0000FF; ">const</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> </span><span style="color: #000000; ">*</span><span style="color: #000000; ">b)<br />{<br />    Node </span><span style="color: #000000; ">*</span><span style="color: #000000; ">a0 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (Node</span><span style="color: #000000; ">*</span><span style="color: #000000; ">)a;<br />    Node </span><span style="color: #000000; ">*</span><span style="color: #000000; ">b0 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (Node</span><span style="color: #000000; ">*</span><span style="color: #000000; ">)b;<br />    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> a0 </span><span style="color: #000000; ">-></span><span style="color: #000000; "> rs </span><span style="color: #000000; ">-</span><span style="color: #000000; "> b0 </span><span style="color: #000000; ">-></span><span style="color: #000000; "> rs;<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; "> i, j;<br />    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> n;<br />    scanf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, </span><span style="color: #000000; ">&</span><span style="color: #000000; ">n);<br />    </span><span style="color: #0000FF; ">while</span><span style="color: #000000; ">(n </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">)<br />    {<br />        </span><span style="color: #0000FF; ">for</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; ">; i </span><span style="color: #000000; "><</span><span style="color: #000000; "> n; i</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)<br />            scanf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, </span><span style="color: #000000; ">&</span><span style="color: #000000; ">num[i]);<br />        seqlen </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; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">; i </span><span style="color: #000000; "><</span><span style="color: #000000; "> n; 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; ">0</span><span style="color: #000000; ">; j </span><span style="color: #000000; "><</span><span style="color: #000000; "> n; j</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)<br />                </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(j </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> i)<br />                {<br />                    addseq[seqlen].rs </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[i] </span><span style="color: #000000; ">+</span><span style="color: #000000; "> num[j];<br />                    addseq[seqlen].a </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[i];<br />                    addseq[seqlen].b </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[j];<br />                    subseq[seqlen].rs </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[i] </span><span style="color: #000000; ">-</span><span style="color: #000000; "> num[j];<br />                    subseq[seqlen].a </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[i];<br />                    subseq[seqlen].b </span><span style="color: #000000; ">=</span><span style="color: #000000; "> num[j];<br />                    seqlen</span><span style="color: #000000; ">++</span><span style="color: #000000; ">;<br />                }<br />        qsort(subseq, seqlen, </span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(Node), cmp);<br />        wagamount </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">-</span><span style="color: #000000; ">MAX;<br />        findWinner();<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(wagamount </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #000000; ">-</span><span style="color: #000000; ">MAX)<br />            printf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, wagamount);<br />        </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> <br />            printf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">no solution\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />        scanf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, </span><span style="color: #000000; ">&</span><span style="color: #000000; ">n);<br />    }<br />    </span><span style="color: #008000; ">//</span><span style="color: #008000; ">system("pause");</span><span style="color: #008000; "><br /></span><span style="color: #000000; ">}<br /></span></span></div></div><img src ="http://www.shnenglu.com/hoolee/aggbug/185938.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2012-08-01 21:39 <a href="http://www.shnenglu.com/hoolee/archive/2012/08/01/185938.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>poj3468--緇濆緇忓吀鐨勭嚎孌墊爲棰?/title><link>http://www.shnenglu.com/hoolee/archive/2012/07/31/185779.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Tue, 31 Jul 2012 12:40:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2012/07/31/185779.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/185779.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2012/07/31/185779.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/185779.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/185779.html</trackback:ping><description><![CDATA[綰挎鏍戦錛屾湰棰樺綰挎鏍戠殑鎿嶄綔鏈夊緩鏍戯紙MakeTree()錛夈佹煡鎵撅紙Query()錛夈佹洿鏂幫紙update()錛夈?br />寤烘爲涓嬈″畬鎴愶紝鏃墮棿鑺辮垂涓篛(LogN)錛涙煡璇㈢殑鏃墮棿澶嶆潅搴﹂剻浜鴻繕涓嶄細鍒嗘瀽O(∩_∩)O~錛屾渶鍧忓彲鑳芥槸O(N)錛屼笉榪囪繖縐嶆儏鍐靛簲璇ュ緢闅懼嚭鐜幫紱鏇存柊鐨勭畻娉曞煎緱鍟嗘Ψ錛屼笉鍚岀殑絳栫暐鏃墮棿澶嶆潅搴︿細鐩稿樊寰堝ぇ銆備笅闈㈣瑙d袱縐嶆瘮杈冪敤浠ユ兂鍒扮殑鏇存柊絳栫暐銆?br />鏇存柊鏂規(guī)硶涓錛?br />姣忔閮藉皢鎵鏈夎兘鏇存柊鐨勮妭鐐規(guī)洿鏂幫紝榪欑鏂瑰紡鏈鍧忔儏鍐典笅灝嗕細鏇存柊鏍戜腑鎵鏈夎妭鐐癸紝姝ゆ椂鏃墮棿澶嶆潅搴︿負O(N)銆傛湰棰樹嬌鐢ㄨ繖縐嶆柟娉曚細TLE銆?br />鏇存柊鏂規(guī)硶浜岋細<br />姣忔閮藉敖閲忓皯鐨勬洿鏂拌妭鐐逛俊鎭紝涓庣涓縐嶆柟娉曠浉姣旓紝Node鍐呬細澶氫竴涓彉閲廵n錛屾垜鎶婂畠褰㈣薄鐨勭О涔嬩負“鍔胯兘”錛岃綆楃粨鏋滄椂瑕佸皢璇ョ殑鎵鏈夌埗鑺傜偣鐨?#8220;鍔胯兘”涔熻冭檻鍦ㄥ唴銆傝繖縐嶆柟娉曠殑鏃墮棿澶嶆潅搴︿篃涓嶅ソ鍒嗘瀽錛屼絾鏄庢樉浼樹簬絎竴縐嶆柟娉曘?br />榪欎竴棰樺鏃墮棿鍗$殑寰堢揣錛屼富瑕佹槸鑺卞湪鏍戠殑鏇存柊涓娿?br />鍏充簬綰挎鏍戝彲浠ュ厛鍙傞槄錛?a href="http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html">http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html</a><br />浠ヤ笅鏄湰棰樹唬鐮侊細 <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Code_Closed_Image_203941" onclick="this.style.display='none'; Code_Closed_Text_203941.style.display='none'; Code_Open_Image_203941.style.display='inline'; Code_Open_Text_203941.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top"><img id="Code_Open_Image_203941" style="display: none" onclick="this.style.display='none'; Code_Open_Text_203941.style.display='none'; Code_Closed_Image_203941.style.display='inline'; Code_Closed_Text_203941.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top"><span id="Code_Closed_Text_203941" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"></span><span id="Code_Open_Text_203941" style="display: none"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /><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 /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #000000">stdlib.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> LEN 100010</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> LEN0 6550000</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" />typedef </span><span style="color: #0000ff">struct</span><span style="color: #000000"> <br /><img id="Codehighlighter1_93_172_Open_Image" onclick="this.style.display='none'; Codehighlighter1_93_172_Open_Text.style.display='none'; Codehighlighter1_93_172_Closed_Image.style.display='inline'; Codehighlighter1_93_172_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_93_172_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_93_172_Closed_Text.style.display='none'; Codehighlighter1_93_172_Open_Image.style.display='inline'; Codehighlighter1_93_172_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_93_172_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_93_172_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> a, b;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> l, r;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> sum;</span><span style="color: #008000">//</span><span style="color: #008000">璁板綍璇ュ尯闂村唴鐨勯儴鍒嗗拰</span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> en;</span><span style="color: #008000">//</span><span style="color: #008000">璁板綍璇ヨ妭鐐?#8220;鍔胯兘”銆?/span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /></span><span style="color: #000000">}</span></span><span style="color: #000000">Node;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> count;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" />Node A[LEN0];<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> allNum[LEN];<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> MakeTree(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i)<br /><img id="Codehighlighter1_242_551_Open_Image" onclick="this.style.display='none'; Codehighlighter1_242_551_Open_Text.style.display='none'; Codehighlighter1_242_551_Closed_Image.style.display='inline'; Codehighlighter1_242_551_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_242_551_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_242_551_Closed_Text.style.display='none'; Codehighlighter1_242_551_Open_Image.style.display='inline'; Codehighlighter1_242_551_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_242_551_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_242_551_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[i].en </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> a </span><span style="color: #000000">=</span><span style="color: #000000"> A[i].a;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> b </span><span style="color: #000000">=</span><span style="color: #000000"> A[i].b;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> mid </span><span style="color: #000000">=</span><span style="color: #000000"> (a </span><span style="color: #000000">+</span><span style="color: #000000"> b) </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(a </span><span style="color: #000000">==</span><span style="color: #000000"> b)<br /><img id="Codehighlighter1_329_366_Open_Image" onclick="this.style.display='none'; Codehighlighter1_329_366_Open_Text.style.display='none'; Codehighlighter1_329_366_Closed_Image.style.display='inline'; Codehighlighter1_329_366_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_329_366_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_329_366_Closed_Text.style.display='none'; Codehighlighter1_329_366_Open_Image.style.display='inline'; Codehighlighter1_329_366_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_329_366_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_329_366_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        A[i].sum </span><span style="color: #000000">=</span><span style="color: #000000"> allNum[a];<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> l </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">++</span><span style="color: #000000">count;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> r </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">++</span><span style="color: #000000">count;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[l].a </span><span style="color: #000000">=</span><span style="color: #000000"> a;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[l].b </span><span style="color: #000000">=</span><span style="color: #000000"> mid;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[r].a </span><span style="color: #000000">=</span><span style="color: #000000"> mid </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[r].b </span><span style="color: #000000">=</span><span style="color: #000000"> b;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    MakeTree(l);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    MakeTree(r);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[i].sum </span><span style="color: #000000">=</span><span style="color: #000000"> A[l].sum </span><span style="color: #000000">+</span><span style="color: #000000"> A[r].sum;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[i].l </span><span style="color: #000000">=</span><span style="color: #000000"> l;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[i].r </span><span style="color: #000000">=</span><span style="color: #000000"> r;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> Query(</span><span style="color: #0000ff">int</span><span style="color: #000000"> t, </span><span style="color: #0000ff">int</span><span style="color: #000000"> aa, </span><span style="color: #0000ff">int</span><span style="color: #000000"> bb, </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> en)<br /><img id="Codehighlighter1_606_1012_Open_Image" onclick="this.style.display='none'; Codehighlighter1_606_1012_Open_Text.style.display='none'; Codehighlighter1_606_1012_Closed_Image.style.display='inline'; Codehighlighter1_606_1012_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_606_1012_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_606_1012_Closed_Text.style.display='none'; Codehighlighter1_606_1012_Open_Image.style.display='inline'; Codehighlighter1_606_1012_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_606_1012_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_606_1012_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> a </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].a;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> b </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].b;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(a </span><span style="color: #000000">==</span><span style="color: #000000"> aa </span><span style="color: #000000">&&</span><span style="color: #000000"> b </span><span style="color: #000000">==</span><span style="color: #000000"> bb)</span><span style="color: #008000">//</span><span style="color: #008000">1</span><span style="color: #008000"><br /><img id="Codehighlighter1_670_714_Open_Image" onclick="this.style.display='none'; Codehighlighter1_670_714_Open_Text.style.display='none'; Codehighlighter1_670_714_Closed_Image.style.display='inline'; Codehighlighter1_670_714_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_670_714_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_670_714_Closed_Text.style.display='none'; Codehighlighter1_670_714_Open_Image.style.display='inline'; Codehighlighter1_670_714_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"></span><span style="color: #000000">    </span><span id="Codehighlighter1_670_714_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_670_714_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> A[t].sum </span><span style="color: #000000">+</span><span style="color: #000000"> en </span><span style="color: #000000">*</span><span style="color: #000000"> (bb </span><span style="color: #000000">-</span><span style="color: #000000"> aa </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">); <br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> mid </span><span style="color: #000000">=</span><span style="color: #000000"> (a </span><span style="color: #000000">+</span><span style="color: #000000"> b) </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(bb </span><span style="color: #000000"><=</span><span style="color: #000000"> mid)</span><span style="color: #008000">//</span><span style="color: #008000">2</span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">        </span><span style="color: #0000ff">return</span><span style="color: #000000"> Query(A[t].l, aa, bb, en </span><span style="color: #000000">+</span><span style="color: #000000"> A[t].en);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(aa </span><span style="color: #000000">>=</span><span style="color: #000000"> mid </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: #008000">//</span><span style="color: #008000">3</span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">        </span><span style="color: #0000ff">return</span><span style="color: #000000"> Query(A[t].r, aa, bb, en </span><span style="color: #000000">+</span><span style="color: #000000"> A[t].en);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> suml </span><span style="color: #000000">=</span><span style="color: #000000"> Query(A[t].l, aa, mid, en </span><span style="color: #000000">+</span><span style="color: #000000"> A[t].en);</span><span style="color: #008000">//</span><span style="color: #008000">4</span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> sumr </span><span style="color: #000000">=</span><span style="color: #000000"> Query(A[t].r, mid </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">, bb, en </span><span style="color: #000000">+</span><span style="color: #000000"> A[t].en);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> suml </span><span style="color: #000000">+</span><span style="color: #000000"> sumr;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> Update(</span><span style="color: #0000ff">int</span><span style="color: #000000"> t, </span><span style="color: #0000ff">int</span><span style="color: #000000"> aa, </span><span style="color: #0000ff">int</span><span style="color: #000000"> bb, </span><span style="color: #0000ff">int</span><span style="color: #000000"> c)<br /><img id="Codehighlighter1_1056_1393_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1056_1393_Open_Text.style.display='none'; Codehighlighter1_1056_1393_Closed_Image.style.display='inline'; Codehighlighter1_1056_1393_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_1056_1393_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1056_1393_Closed_Text.style.display='none'; Codehighlighter1_1056_1393_Open_Image.style.display='inline'; Codehighlighter1_1056_1393_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_1056_1393_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1056_1393_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> a </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].a;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> b </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].b;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> mid </span><span style="color: #000000">=</span><span style="color: #000000"> (a </span><span style="color: #000000">+</span><span style="color: #000000"> b) </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> l </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].l;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> r </span><span style="color: #000000">=</span><span style="color: #000000"> A[t].r;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[t].sum </span><span style="color: #000000">+=</span><span style="color: #000000"> (bb </span><span style="color: #000000">-</span><span style="color: #000000"> aa </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"> c;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(aa </span><span style="color: #000000">==</span><span style="color: #000000"> a </span><span style="color: #000000">&&</span><span style="color: #000000"> bb </span><span style="color: #000000">==</span><span style="color: #000000"> b)<br /><img id="Codehighlighter1_1207_1236_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1207_1236_Open_Text.style.display='none'; Codehighlighter1_1207_1236_Closed_Image.style.display='inline'; Codehighlighter1_1207_1236_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_1207_1236_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1207_1236_Closed_Text.style.display='none'; Codehighlighter1_1207_1236_Open_Image.style.display='inline'; Codehighlighter1_1207_1236_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_1207_1236_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1207_1236_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        A[t].en </span><span style="color: #000000">+=</span><span style="color: #000000"> c;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(bb </span><span style="color: #000000"><=</span><span style="color: #000000"> mid)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Update(l, aa, bb, c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(aa </span><span style="color: #000000">>=</span><span style="color: #000000"> mid </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Update(r, aa, bb, c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">else</span><span style="color: #000000"><br /><img id="Codehighlighter1_1332_1389_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1332_1389_Open_Text.style.display='none'; Codehighlighter1_1332_1389_Closed_Image.style.display='inline'; Codehighlighter1_1332_1389_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_1332_1389_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1332_1389_Closed_Text.style.display='none'; Codehighlighter1_1332_1389_Open_Image.style.display='inline'; Codehighlighter1_1332_1389_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_1332_1389_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1332_1389_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Update(l, aa, mid, c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Update(r, mid </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">, bb, c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> main()<br /><img id="Codehighlighter1_1406_1908_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1406_1908_Open_Text.style.display='none'; Codehighlighter1_1406_1908_Closed_Image.style.display='inline'; Codehighlighter1_1406_1908_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_1406_1908_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1406_1908_Closed_Text.style.display='none'; Codehighlighter1_1406_1908_Open_Image.style.display='inline'; Codehighlighter1_1406_1908_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_1406_1908_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1406_1908_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i, j;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> N, Q;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> a, b, c;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d%d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">N, </span><span style="color: #000000">&</span><span style="color: #000000">Q);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">for</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">; i </span><span style="color: #000000"><=</span><span style="color: #000000"> N; i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">allNum[i]);    <br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    count </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> t </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">++</span><span style="color: #000000">count;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[t].a </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    A[t].b </span><span style="color: #000000">=</span><span style="color: #000000"> N;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    MakeTree(t);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">char</span><span style="color: #000000"> str[</span><span style="color: #000000">50</span><span style="color: #000000">];<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    getchar();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">for</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">; i </span><span style="color: #000000"><</span><span style="color: #000000"> Q; i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1643_1886_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1643_1886_Open_Text.style.display='none'; Codehighlighter1_1643_1886_Closed_Image.style.display='inline'; Codehighlighter1_1643_1886_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_1643_1886_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1643_1886_Closed_Text.style.display='none'; Codehighlighter1_1643_1886_Open_Image.style.display='inline'; Codehighlighter1_1643_1886_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_1643_1886_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1643_1886_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        gets(str);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(str[</span><span style="color: #000000">0</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">Q</span><span style="color: #000000">'</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1680_1785_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1680_1785_Open_Text.style.display='none'; Codehighlighter1_1680_1785_Closed_Image.style.display='inline'; Codehighlighter1_1680_1785_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_1680_1785_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1680_1785_Closed_Text.style.display='none'; Codehighlighter1_1680_1785_Open_Image.style.display='inline'; Codehighlighter1_1680_1785_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">        </span><span id="Codehighlighter1_1680_1785_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1680_1785_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            sscanf(</span><span style="color: #000000">&</span><span style="color: #000000">str[</span><span style="color: #000000">1</span><span style="color: #000000">], </span><span style="color: #000000">"</span><span style="color: #000000">%d%d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">a, </span><span style="color: #000000">&</span><span style="color: #000000">b);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">long</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> sum </span><span style="color: #000000">=</span><span style="color: #000000"> Query(</span><span style="color: #000000">1</span><span style="color: #000000">, a, b, </span><span style="color: #000000">0</span><span style="color: #000000">);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            printf(</span><span style="color: #000000">"</span><span style="color: #000000">%lld\n</span><span style="color: #000000">"</span><span style="color: #000000">, sum);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(str[</span><span style="color: #000000">0</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">C</span><span style="color: #000000">'</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1814_1883_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1814_1883_Open_Text.style.display='none'; Codehighlighter1_1814_1883_Closed_Image.style.display='inline'; Codehighlighter1_1814_1883_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_1814_1883_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1814_1883_Closed_Text.style.display='none'; Codehighlighter1_1814_1883_Open_Image.style.display='inline'; Codehighlighter1_1814_1883_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top">        </span><span id="Codehighlighter1_1814_1883_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1814_1883_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            sscanf(</span><span style="color: #000000">&</span><span style="color: #000000">str[</span><span style="color: #000000">1</span><span style="color: #000000">], </span><span style="color: #000000">"</span><span style="color: #000000">%d%d%d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">a, </span><span style="color: #000000">&</span><span style="color: #000000">b, </span><span style="color: #000000">&</span><span style="color: #000000">c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            Update(</span><span style="color: #000000">1</span><span style="color: #000000">, a, b, c);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">system("pause");</span><span style="color: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /></span><span style="color: #000000">}</span></span></span></div><br /><img src ="http://www.shnenglu.com/hoolee/aggbug/185779.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2012-07-31 20:40 <a href="http://www.shnenglu.com/hoolee/archive/2012/07/31/185779.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>綰挎鏍?/title><link>http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Sun, 29 Jul 2012 02:44:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/185531.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/185531.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/185531.html</trackback:ping><description><![CDATA[     鎽樿: 榪欐槸鎴戝啓鐨勭涓閬撶嚎孌墊爲錛屾濊礬榪樼畻娓呮櫚錛屼笉榪囦箣鍓嶈蛋浜嗕笉灝戝集璺備富瑕侀敊鍦細璇互涓虹嚎孌墊爲鏄竴媯墊弧浜屽弶鏍戯紝寤烘爲鏃跺悆浜嗚嫤澶淬?/綰挎鏍戦櫎浜嗘渶鍚庝竴灞傚彲鑳戒笉婊¤凍婊′簩鍙夋爲鎬ц川澶栵紝涓婇潰鐨勬墍鏈夊眰鏋勬垚瀹屽叏浜屽弶鏍戯紝鍥犳浠嶇劧鍙互鐢ㄦ弧浜屽弶鏍戠殑鎬ц川錛氬鏋滄爲鏍硅妭鐐逛粠1寮濮嬬紪鍙鳳紝鍒欏浠繪剰緙栧彿鐨勮妭鐐箃錛屽乏瀛愭爲緙栧彿涓簍*2錛屽彸瀛愭爲緙栧彿涓簍*2+1錛岀埗鑺傜偣緙栧彿涓簍/2銆傝繖鏍鳳紝寤烘爲鐨勬椂鍊欒妭鐐瑰唴灝變笉鐢ㄨ褰曞効瀛愭垨鐖惰妭鐐圭殑淇℃伅浜嗐備笅闈㈢粨鍚坧oj...  <a href='http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/hoolee/aggbug/185531.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2012-07-29 10:44 <a href="http://www.shnenglu.com/hoolee/archive/2012/07/29/185531.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>poj1862--浼樺厛闃熷垪銆佽椽蹇?/title><link>http://www.shnenglu.com/hoolee/archive/2012/07/21/184517.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Sat, 21 Jul 2012 14:22:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2012/07/21/184517.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/184517.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2012/07/21/184517.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/184517.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/184517.html</trackback:ping><description><![CDATA[縐戝瀹跺彂鏄庝簡涓縐嶆柊鐨勭敓鐗╋紝榪欑鐢熺墿鑳藉涓や袱鍚堝茍錛岄噸閲忎負m1鐨勭敓鐗╀笌閲嶉噺涓簃2鐨勭敓鐗╁悎騫跺悗鍙樹負涓涓敓鐗╋紝璇ョ敓鐗╃殑閲嶉噺涓?*sqrt(m1*m2)銆傛眰緇欏畾鏁伴噺鐨勭敓鐗╁悎騫舵垚涓涓敓鐗╁悗鐨勬渶灝忛噸閲忋?br />璐績綆楁硶錛屾瘡嬈¢夊彇閲嶉噺鏈澶х殑涓や釜鐢熺墿鍚堝茍鎴愪竴涓嵆鍙備笅闈㈢殑浠g爜鏄湁浼樺厛闃熷垪錛堝ぇ欏跺爢錛夊疄鐜扮殑銆?br />涓嶈繃錛屾繁鍏ュ垎鏋愪竴涓嬶紝鐢辨暟瀛﹀叕寮忓彲浠ヨ瘉鏄庯細m1+m2 >= 2*sqrt(m1*m2)錛屽洜姝ゅ綋涓や釜鐢熺墿鍚堝茍鍚庯紝閲嶉噺涓瀹氭槸鍓╀綑鐢熺墿涓渶澶х殑錛岀敱姝ゅ彧瑕佸皢鍘熼噸閲忔寜闄嶅簭鎺掑簭涓嬈★紝鐒跺悗渚濇鍚堝茍鍗沖彲銆?br />浼樺厛闃熷垪鏈変簺澶ф潗灝忕敤浜嗐? <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><img id="Code_Closed_Image_222116" onclick="this.style.display='none'; Code_Closed_Text_222116.style.display='none'; Code_Open_Image_222116.style.display='inline'; Code_Open_Text_222116.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" height="16"><img style="display: none" id="Code_Open_Image_222116" onclick="this.style.display='none'; Code_Open_Text_222116.style.display='none'; Code_Closed_Image_222116.style.display='inline'; Code_Closed_Text_222116.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" height="16"><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Code_Closed_Text_222116"></span><span style="display: none" id="Code_Open_Text_222116"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><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 /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #000000">stdlib.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #000000">math.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> LEN 110</span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> f(</span><span style="color: #0000ff">double</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> top, </span><span style="color: #0000ff">int</span><span style="color: #000000"> r)<br /><img id="Codehighlighter1_104_299_Open_Image" onclick="this.style.display='none'; Codehighlighter1_104_299_Open_Text.style.display='none'; Codehighlighter1_104_299_Closed_Image.style.display='inline'; Codehighlighter1_104_299_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_104_299_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_104_299_Closed_Text.style.display='none'; Codehighlighter1_104_299_Open_Image.style.display='inline'; Codehighlighter1_104_299_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_104_299_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_104_299_Open_Text"><span style="color: #000000">{</span><span style="color: #008000">//</span><span style="color: #008000">絳涢夊嚱鏁幫紝淇濇寔澶ч《鍫嗙殑鎬ц川銆?/span><span style="color: #008000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i, j;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </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">2</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> top; j </span><span style="color: #000000"><=</span><span style="color: #000000"> r; j </span><span style="color: #000000">*=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">)<br /><img id="Codehighlighter1_168_297_Open_Image" onclick="this.style.display='none'; Codehighlighter1_168_297_Open_Text.style.display='none'; Codehighlighter1_168_297_Closed_Image.style.display='inline'; Codehighlighter1_168_297_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_168_297_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_168_297_Closed_Text.style.display='none'; Codehighlighter1_168_297_Open_Image.style.display='inline'; Codehighlighter1_168_297_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_168_297_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_168_297_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(j </span><span style="color: #000000"><</span><span style="color: #000000"> r </span><span style="color: #000000">&&</span><span style="color: #000000"> a[j] </span><span style="color: #000000"><</span><span style="color: #000000"> a[j </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">])<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            j</span><span style="color: #000000">++</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(a[j] </span><span style="color: #000000"><=</span><span style="color: #000000"> a[j </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">])<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">break</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> t </span><span style="color: #000000">=</span><span style="color: #000000"> a[j];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        a[j] </span><span style="color: #000000">=</span><span style="color: #000000"> a[j </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        a[j </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> t;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">double</span><span style="color: #000000"> DeQueue(</span><span style="color: #0000ff">double</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">r)<br /><img id="Codehighlighter1_335_402_Open_Image" onclick="this.style.display='none'; Codehighlighter1_335_402_Open_Text.style.display='none'; Codehighlighter1_335_402_Closed_Image.style.display='inline'; Codehighlighter1_335_402_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_335_402_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_335_402_Closed_Text.style.display='none'; Codehighlighter1_335_402_Open_Image.style.display='inline'; Codehighlighter1_335_402_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_335_402_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_335_402_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> t </span><span style="color: #000000">=</span><span style="color: #000000"> a[</span><span style="color: #000000">1</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    a[</span><span style="color: #000000">1</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> a[</span><span style="color: #000000">*</span><span style="color: #000000">r];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #000000">--*</span><span style="color: #000000">r;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    f(a, </span><span style="color: #000000">1</span><span style="color: #000000">, </span><span style="color: #000000">*</span><span style="color: #000000">r);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> t;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> EnQueue(</span><span style="color: #0000ff">double</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">r, </span><span style="color: #0000ff">double</span><span style="color: #000000"> num)<br /><img id="Codehighlighter1_448_624_Open_Image" onclick="this.style.display='none'; Codehighlighter1_448_624_Open_Text.style.display='none'; Codehighlighter1_448_624_Closed_Image.style.display='inline'; Codehighlighter1_448_624_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_448_624_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_448_624_Closed_Text.style.display='none'; Codehighlighter1_448_624_Open_Image.style.display='inline'; Codehighlighter1_448_624_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_448_624_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_448_624_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #000000">++*</span><span style="color: #000000">r;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    a[</span><span style="color: #000000">*</span><span style="color: #000000">r] </span><span style="color: #000000">=</span><span style="color: #000000"> num;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </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">*</span><span style="color: #000000">r;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">while</span><span style="color: #000000">(</span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img id="Codehighlighter1_495_622_Open_Image" onclick="this.style.display='none'; Codehighlighter1_495_622_Open_Text.style.display='none'; Codehighlighter1_495_622_Closed_Image.style.display='inline'; Codehighlighter1_495_622_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_495_622_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_495_622_Closed_Text.style.display='none'; Codehighlighter1_495_622_Open_Image.style.display='inline'; Codehighlighter1_495_622_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_495_622_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_495_622_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">if</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"> </span><span style="color: #000000">&&</span><span style="color: #000000"> a[i] </span><span style="color: #000000">></span><span style="color: #000000"> a[i </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">])<br /><img id="Codehighlighter1_530_602_Open_Image" onclick="this.style.display='none'; Codehighlighter1_530_602_Open_Text.style.display='none'; Codehighlighter1_530_602_Closed_Image.style.display='inline'; Codehighlighter1_530_602_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_530_602_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_530_602_Closed_Text.style.display='none'; Codehighlighter1_530_602_Open_Image.style.display='inline'; Codehighlighter1_530_602_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif">        </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_530_602_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_530_602_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">double</span><span style="color: #000000"> t </span><span style="color: #000000">=</span><span style="color: #000000"> a[i];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            a[i] </span><span style="color: #000000">=</span><span style="color: #000000"> a[i </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            a[i </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> t;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            i </span><span style="color: #000000">/=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">else</span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">break</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> main()<br /><img id="Codehighlighter1_637_1012_Open_Image" onclick="this.style.display='none'; Codehighlighter1_637_1012_Open_Text.style.display='none'; Codehighlighter1_637_1012_Closed_Image.style.display='inline'; Codehighlighter1_637_1012_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_637_1012_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_637_1012_Closed_Text.style.display='none'; Codehighlighter1_637_1012_Open_Image.style.display='inline'; Codehighlighter1_637_1012_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_637_1012_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_637_1012_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i, j;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> N;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> r;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> a[LEN];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> w;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">while</span><span style="color: #000000">(scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">N) </span><span style="color: #000000">!=</span><span style="color: #000000"> EOF)<br /><img id="Codehighlighter1_725_1010_Open_Image" onclick="this.style.display='none'; Codehighlighter1_725_1010_Open_Text.style.display='none'; Codehighlighter1_725_1010_Closed_Image.style.display='inline'; Codehighlighter1_725_1010_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_725_1010_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_725_1010_Closed_Text.style.display='none'; Codehighlighter1_725_1010_Open_Image.style.display='inline'; Codehighlighter1_725_1010_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_725_1010_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_725_1010_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">for</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">; i </span><span style="color: #000000"><=</span><span style="color: #000000"> N; i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%lf</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">&</span><span style="color: #000000">a[i]);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(i </span><span style="color: #000000">=</span><span style="color: #000000"> N </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</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">; i</span><span style="color: #000000">--</span><span style="color: #000000">)</span><span style="color: #008000">//</span><span style="color: #008000">寤虹珛澶ч《鍫嗭紝鍗蟲槸鍒濆鍖栭槦鍒?/span><span style="color: #008000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" /></span><span style="color: #000000">            f(a, i, N);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        r </span><span style="color: #000000">=</span><span style="color: #000000"> N;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">while</span><span style="color: #000000">(r </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img id="Codehighlighter1_863_979_Open_Image" onclick="this.style.display='none'; Codehighlighter1_863_979_Open_Text.style.display='none'; Codehighlighter1_863_979_Closed_Image.style.display='inline'; Codehighlighter1_863_979_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_863_979_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_863_979_Closed_Text.style.display='none'; Codehighlighter1_863_979_Open_Image.style.display='inline'; Codehighlighter1_863_979_Open_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif">        </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_863_979_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_863_979_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">double</span><span style="color: #000000"> m1 </span><span style="color: #000000">=</span><span style="color: #000000"> DeQueue(a, </span><span style="color: #000000">&</span><span style="color: #000000">r);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">double</span><span style="color: #000000"> m2 </span><span style="color: #000000">=</span><span style="color: #000000"> DeQueue(a, </span><span style="color: #000000">&</span><span style="color: #000000">r);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            w </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">2.0</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> sqrt(m1 </span><span style="color: #000000">*</span><span style="color: #000000"> m2);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            EnQueue(a, </span><span style="color: #000000">&</span><span style="color: #000000">r, w);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        printf(</span><span style="color: #000000">"</span><span style="color: #000000">%.3lf\n</span><span style="color: #000000">"</span><span style="color: #000000">, a[</span><span style="color: #000000">1</span><span style="color: #000000">]);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span></span></div><br /><img src ="http://www.shnenglu.com/hoolee/aggbug/184517.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2012-07-21 22:22 <a href="http://www.shnenglu.com/hoolee/archive/2012/07/21/184517.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浼樺厛闃熷垪--鍫嗗疄鐜?/title><link>http://www.shnenglu.com/hoolee/archive/2012/07/20/184309.html</link><dc:creator>灝忛紶鏍?/dc:creator><author>灝忛紶鏍?/author><pubDate>Fri, 20 Jul 2012 02:36:00 GMT</pubDate><guid>http://www.shnenglu.com/hoolee/archive/2012/07/20/184309.html</guid><wfw:comment>http://www.shnenglu.com/hoolee/comments/184309.html</wfw:comment><comments>http://www.shnenglu.com/hoolee/archive/2012/07/20/184309.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/hoolee/comments/commentRss/184309.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/hoolee/services/trackbacks/184309.html</trackback:ping><description><![CDATA[     鎽樿: 浼樺厛闃熷垪錛屽叾瀹炴垜涓鐩翠笉鎰挎壙璁も滀紭鍏堥槦鍒椻濇槸涓縐嶁滈槦鍒椻濓紝鐜板疄涓栫晫鐨勯槦鍒楋紙姣斿鎺掗槦錛夊憡璇夋垜浠紝闃熷垪鏈鏄庢樉鐨勬ц川灝辨槸鍏堣繘鍏堝嚭銆傝屼紭鍏堥槦鍒楋紝浼間箮璺熻繖涓鍒欐病浠涔堝叧緋燴︹?nbsp; <a href='http://www.shnenglu.com/hoolee/archive/2012/07/20/184309.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/hoolee/aggbug/184309.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/hoolee/" target="_blank">灝忛紶鏍?/a> 2012-07-20 10:36 <a href="http://www.shnenglu.com/hoolee/archive/2012/07/20/184309.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍗曡皟闃熷垪http://www.shnenglu.com/hoolee/archive/2012/07/19/184177.html灝忛紶鏍?/dc:creator>灝忛紶鏍?/author>Thu, 19 Jul 2012 04:21:00 GMThttp://www.shnenglu.com/hoolee/archive/2012/07/19/184177.htmlhttp://www.shnenglu.com/hoolee/comments/184177.htmlhttp://www.shnenglu.com/hoolee/archive/2012/07/19/184177.html#Feedback0http://www.shnenglu.com/hoolee/comments/commentRss/184177.htmlhttp://www.shnenglu.com/hoolee/services/trackbacks/184177.html闃呰鍏ㄦ枃

]]>
国产精品久久久香蕉| 久久久精品免费国产四虎| 香蕉久久夜色精品国产尤物| 国产精品久久久久影院色| 欧美亚洲国产精品久久久久| 亚洲国产一成久久精品国产成人综合 | 久久国产香蕉视频| 色综合久久久久综合体桃花网 | 麻豆久久久9性大片| 7777久久久国产精品消防器材| 久久人妻少妇嫩草AV无码蜜桃| 一本久久免费视频| 狠狠狠色丁香婷婷综合久久俺| 亚洲午夜久久久久妓女影院| 国产精品99久久久久久猫咪 | 亚洲成色WWW久久网站| 久久国产精品波多野结衣AV| 国产精品女同久久久久电影院| 欧洲性大片xxxxx久久久| 一级a性色生活片久久无少妇一级婬片免费放 | 国产午夜精品理论片久久 | 亚洲av成人无码久久精品| 亚洲国产日韩欧美久久| 久久久久亚洲AV无码专区桃色 | 伊人久久大香线蕉精品| 天天爽天天狠久久久综合麻豆| 51久久夜色精品国产| 久久亚洲精品人成综合网| 久久综合九色综合网站| av国内精品久久久久影院| 亚洲AV日韩精品久久久久久久| 伊人久久大香线蕉成人| 久久偷看各类wc女厕嘘嘘| 93精91精品国产综合久久香蕉| 青青草国产精品久久久久| 久久久久九国产精品| 国产国产成人精品久久| 精品久久久久久综合日本| 久久午夜无码鲁丝片午夜精品| 开心久久婷婷综合中文字幕| 久久亚洲国产精品123区|