锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲女久久久噜噜噜熟女,久久精品中文騷妇女内射,97热久久免费频精品99http://www.shnenglu.com/yzhw/category/15164.htmlzh-cnThu, 21 Jul 2011 04:20:37 GMTThu, 21 Jul 2011 04:20:37 GMT60pku1309 鏁板浼樺寲+鏋氫婦http://www.shnenglu.com/yzhw/archive/2011/07/19/151338.htmlyzhwyzhwMon, 18 Jul 2011 16:10:00 GMThttp://www.shnenglu.com/yzhw/archive/2011/07/19/151338.htmlhttp://www.shnenglu.com/yzhw/comments/151338.htmlhttp://www.shnenglu.com/yzhw/archive/2011/07/19/151338.html#Feedback0http://www.shnenglu.com/yzhw/comments/commentRss/151338.htmlhttp://www.shnenglu.com/yzhw/services/trackbacks/151338.html
Coconuts, Revisited
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 1832
Accepted: 737

Description

The short story titled Coconuts, by Ben Ames Williams, appeared in the Saturday Evening Post on October 9, 1926. The story tells about five men and a monkey who were shipwrecked on an island. They spent the first night gathering coconuts. During the night, one man woke up and decided to take his share of the coconuts. He divided them into five piles. One coconut was left over so he gave it to the monkey, then hid his share and went back to sheep.

Soon a second man woke up and did the same thing. After dividing the coconuts into five piles, one coconut was left over which he gave to the monkey. He then hid his share and went back to bed. The third, fourth, and fifth man followed exactly the same procedure. The next morning, after they all woke up, they divided the remaining coconuts into five equal shares. This time no coconuts were left over.

An obvious question is "how many coconuts did they originally gather?" There are an infinite number of answers, but the lowest of these is 3,121. But that's not our problem here.

Suppose we turn the problem around. If we know the number of coconuts that were gathered, what is the maximum number of persons (and one monkey) that could have been shipwrecked if the same procedure could occur?

Input

The input will consist of a sequence of integers, each representing the number of coconuts gathered by a group of persons (and a monkey) that were shipwrecked. The sequence will be followed by a negative number.

Output

For each number of coconuts, determine the largest number of persons who could have participated in the procedure described above. Display the results similar to the manner shown below, in the Expected Output. There may be no solution for some of the input cases; if so, state that observation.

Sample Input

25 30 3121 -1

Sample Output

25 coconuts, 3 people and 1 monkey 30 coconuts, no solution 3121 coconuts, 5 people and 1 monkey

Source


瑙f硶錛?br />棣栧厛鍐欏嚭閫掓帹鍏紡
f(0)=A  A=nk
f(i)=f(i-1)/(n-1)*n+1

闅忎究浠涔堟柟娉曞啓鍑洪棴褰㈠紡
f(n)=[錛坣^n錛?錛圓+n-1錛塢/[錛坣-1錛塣n]-(n-1)
棰樼洰涓憡璇塮(n)鐨勫鹼紝姹俷鏈澶у?br />棣栧厛瑙傚療涓嬪墠闈㈤偅涓垎寮忥紝鐢變簬n鍜宯-1浜掕川錛屾墍浠^n鍜?n-1)^n涔熶簰璐?/span>錛屽垎寮忕粨鏋滆涓轟竴涓暣鏁幫紝f(n)+n-1涓繀欏誨惈鏈夊洜瀛恘^n錛涙崲鍙ヨ瘽璇達紝f(n)+n-1>n^n,棰樼洰涓粰鐨刦(n)鍙互鐢?2浣嶆暣鏁拌〃紺猴紝閭d箞n蹇呯劧灝忎簬12錛?/span>
涓嬮潰涓嶇敤璇翠粈涔堜簡錛屾毚鍔涘惂錛岃偗瀹?MS浜唦涓嶈繃涓轟簡瀹岀編錛宯^n鎴戠敤浜嗕簩榪涘埗蹇熷箓~鍏蜂綋鐪嬩唬鐮佸惂

浠g爜錛?br />
 1 Source Code
 2 Problem: 1309        User: yzhw
 3 Memory: 392K        Time: 0MS
 4 Language: G++        Result: Accepted
 5 
 6     Source Code
 7 
 8     # include <cstdio>
 9     using namespace std;
10     long long pow(int a,int b)
11     {
12         long long ans=1,t=a;
13         while(b)
14         {
15             if(b&1) ans*=t;
16             t*=t;
17             b>>=1;
18         }
19         return ans;
20     }
21     int main()
22     {
23         //freopen("input.txt","r",stdin);
24         int n;
25         while(scanf("%d",&n)!=EOF&&n>=0)
26         {
27             int ans=-1,i;
28             for(i=2;i<=12;i++)
29             {
30                 long long t=n;
31                 t+=i-1;
32                 long long t1=pow(i,i),t2=pow(i-1,i);
33                 if(t%t1==0)
34                 {
35                     t=t/t1*t2-i+1;
36                     if(t>=0&&t%i==0) ans=i;
37                 }
38             }
39             if(ans==-1) printf("%d coconuts, no solution\n",n);
40             else printf("%d coconuts, %d people and 1 monkey\n",n,ans);
41         }
42         return 0;
43     }
44 
45 


yzhw 2011-07-19 00:10 鍙戣〃璇勮
]]>
pku1894-1903 Northeastern Europe 2003 瑙i鎶ュ憡http://www.shnenglu.com/yzhw/archive/2011/02/04/139716.htmlyzhwyzhwThu, 03 Feb 2011 17:08:00 GMThttp://www.shnenglu.com/yzhw/archive/2011/02/04/139716.htmlhttp://www.shnenglu.com/yzhw/comments/139716.htmlhttp://www.shnenglu.com/yzhw/archive/2011/02/04/139716.html#Feedback0http://www.shnenglu.com/yzhw/comments/commentRss/139716.htmlhttp://www.shnenglu.com/yzhw/services/trackbacks/139716.html闃呰鍏ㄦ枃

yzhw 2011-02-04 01:08 鍙戣〃璇勮
]]>
pku2894-2903 Tehran 2005 姣旇禌鎬葷粨http://www.shnenglu.com/yzhw/archive/2011/01/31/139630.htmlyzhwyzhwSun, 30 Jan 2011 17:59:00 GMThttp://www.shnenglu.com/yzhw/archive/2011/01/31/139630.htmlhttp://www.shnenglu.com/yzhw/comments/139630.htmlhttp://www.shnenglu.com/yzhw/archive/2011/01/31/139630.html#Feedback1http://www.shnenglu.com/yzhw/comments/commentRss/139630.htmlhttp://www.shnenglu.com/yzhw/services/trackbacks/139630.html闃呰鍏ㄦ枃

yzhw 2011-01-31 01:59 鍙戣〃璇勮
]]>
pku 3499 Containers 鏁板銆傘?/title><link>http://www.shnenglu.com/yzhw/archive/2010/12/03/135317.html</link><dc:creator>yzhw</dc:creator><author>yzhw</author><pubDate>Thu, 02 Dec 2010 16:13:00 GMT</pubDate><guid>http://www.shnenglu.com/yzhw/archive/2010/12/03/135317.html</guid><wfw:comment>http://www.shnenglu.com/yzhw/comments/135317.html</wfw:comment><comments>http://www.shnenglu.com/yzhw/archive/2010/12/03/135317.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yzhw/comments/commentRss/135317.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yzhw/services/trackbacks/135317.html</trackback:ping><description><![CDATA[棰樻剰鏄繖鏍?br>N涓泦瑁呯錛屼刊瑙嗗浘濡備笅錛屾渶澶氬彔5灞傘傝姹傚簳闈㈢Н鏈灝忋傚鏋滄湁閲嶅鏂規錛岃姹傞暱銆佸鐨勭粷瀵瑰煎樊鏈灝?br><img border=0 alt="" src="http://poj.org/images/3499_1.png" width=554 height=254><br>灝哄錛氶泦瑁呯 8*40 ,姘村鉤闂磋窛錛?錛岀珫鐩撮棿璺濓細2<br><br>棰樿В錛?br>鏋氫婦綰靛悜涓暟錛屾灇涓懼埌sqrt(涓婂彇鏁達紙n/5)鍗沖彲銆?br><br>紼嬪簭錛?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"><span style="COLOR: #008080"> 1</span><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.util.</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img id=Codehighlighter1_38_679_Open_Image onclick="this.style.display='none'; Codehighlighter1_38_679_Open_Text.style.display='none'; Codehighlighter1_38_679_Closed_Image.style.display='inline'; Codehighlighter1_38_679_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_38_679_Closed_Image onclick="this.style.display='none'; Codehighlighter1_38_679_Closed_Text.style.display='none'; Codehighlighter1_38_679_Open_Image.style.display='inline'; Codehighlighter1_38_679_Open_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif"></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Main </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_38_679_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_38_679_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img id=Codehighlighter1_42_65_Open_Image onclick="this.style.display='none'; Codehighlighter1_42_65_Open_Text.style.display='none'; Codehighlighter1_42_65_Closed_Image.style.display='inline'; Codehighlighter1_42_65_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_42_65_Closed_Image onclick="this.style.display='none'; Codehighlighter1_42_65_Closed_Text.style.display='none'; Codehighlighter1_42_65_Open_Image.style.display='inline'; Codehighlighter1_42_65_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_42_65_Closed_Text>/** */</span><span id=Codehighlighter1_42_65_Open_Text><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">     * </span><span style="COLOR: #808080">@param</span><span style="COLOR: #008000"> args<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">     </span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img id=Codehighlighter1_107_676_Open_Image onclick="this.style.display='none'; Codehighlighter1_107_676_Open_Text.style.display='none'; Codehighlighter1_107_676_Closed_Image.style.display='inline'; Codehighlighter1_107_676_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_107_676_Closed_Image onclick="this.style.display='none'; Codehighlighter1_107_676_Closed_Text.style.display='none'; Codehighlighter1_107_676_Open_Image.style.display='inline'; Codehighlighter1_107_676_Open_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args) </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_107_676_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_107_676_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        Scanner in</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Scanner(System.in);<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> test</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">in.nextInt();<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">((test</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img id=Codehighlighter1_194_672_Open_Image onclick="this.style.display='none'; Codehighlighter1_194_672_Open_Text.style.display='none'; Codehighlighter1_194_672_Closed_Image.style.display='inline'; Codehighlighter1_194_672_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_194_672_Closed_Image onclick="this.style.display='none'; Codehighlighter1_194_672_Closed_Text.style.display='none'; Codehighlighter1_194_672_Open_Image.style.display='inline'; Codehighlighter1_194_672_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_194_672_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_194_672_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000"> num</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">in.nextLong();<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            num</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(num</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">num</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">:num</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000"> r1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Long.MAX_VALUE,r2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Long.MAX_VALUE,l</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,w </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: #008080">15</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000"> a</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">num;a</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img id=Codehighlighter1_344_600_Open_Image onclick="this.style.display='none'; Codehighlighter1_344_600_Open_Text.style.display='none'; Codehighlighter1_344_600_Closed_Image.style.display='inline'; Codehighlighter1_344_600_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_344_600_Closed_Image onclick="this.style.display='none'; Codehighlighter1_344_600_Closed_Text.style.display='none'; Codehighlighter1_344_600_Open_Image.style.display='inline'; Codehighlighter1_344_600_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_344_600_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_344_600_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                </span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000"> b</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(num</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">num</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">a:num</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">((a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</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">r1</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">(a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</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">r1</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">Math.abs((a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</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">r2)<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img id=Codehighlighter1_471_575_Open_Image onclick="this.style.display='none'; Codehighlighter1_471_575_Open_Text.style.display='none'; Codehighlighter1_471_575_Closed_Image.style.display='inline'; Codehighlighter1_471_575_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_471_575_Closed_Image onclick="this.style.display='none'; Codehighlighter1_471_575_Closed_Text.style.display='none'; Codehighlighter1_471_575_Open_Image.style.display='inline'; Codehighlighter1_471_575_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_471_575_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_471_575_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                    r1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                    r2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Math.abs((a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">));<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                    l</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(a</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">44</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                    w</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">                }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(b</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            System.out.println(Math.max(w,l)</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> X </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">Math.min(w, l)</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">+</span><span style="COLOR: #000000">r1);<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif">}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span></div> <img src ="http://www.shnenglu.com/yzhw/aggbug/135317.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yzhw/" target="_blank">yzhw</a> 2010-12-03 00:13 <a href="http://www.shnenglu.com/yzhw/archive/2010/12/03/135317.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>The 2010 ACM-ICPC Asia Chengdu Regional Contest Error Curves 涓夊垎娉曟眰鍑稿嚱鏁版瀬鍊?/title><link>http://www.shnenglu.com/yzhw/archive/2010/11/16/133737.html</link><dc:creator>yzhw</dc:creator><author>yzhw</author><pubDate>Mon, 15 Nov 2010 16:50:00 GMT</pubDate><guid>http://www.shnenglu.com/yzhw/archive/2010/11/16/133737.html</guid><wfw:comment>http://www.shnenglu.com/yzhw/comments/133737.html</wfw:comment><comments>http://www.shnenglu.com/yzhw/archive/2010/11/16/133737.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yzhw/comments/commentRss/133737.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yzhw/services/trackbacks/133737.html</trackback:ping><description><![CDATA[<center><span id="53jbhbt" class=bigProblemTitle>Error Curves</span></center> <hr> <center><font color=green>Time Limit: </font>2 Seconds      <font color=green>Memory Limit: </font>65536 KB </center> <hr> <p>Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which has many interesting properties. <p>In order to test the algorithm's efficiency, she collects many datasets. What's more, each data is divided into two parts: training data and test data. She gets the parameters of the model on training data and test the model on test data. <p>To her surprise, she finds each dataset's test error curve is just a parabolic curve. A parabolic curve corresponds to a quadratic function. In mathematics, a quadratic function is a polynomial function of the form <em>f(x) = ax<sup>2</sup> + bx + c</em>. The quadratic will degrade to linear function if <em>a = 0</em>. <p> <div style="TEXT-ALIGN: center"><img alt="Quadric Function" src="http://acm.zju.edu.cn/onlinejudge/showImage.do?name=quadric_function.jpg"></div> <p>It's very easy to calculate the minimal error if there is only one test error curve. However, there are several datasets, which means Josephina will obtain many parabolic curves. Josephina wants to get the tuned parameters that make the best performance on all datasets. So she should take all error curves into account, i.e., she has to deal with many quadric functions and make a new error definition to represent the total error. Now, she focuses on the following new function's minimal which related to multiple quadric functions. <p>The new function <em>F(x)</em> is defined as follow: <center> <p><em>F(x) = max(S<sub>i</sub>(x))</em>, <em>i</em> = 1...<em>n</em>. The domain of <em>x</em> is [0, 1000]. <em>S<sub>i</sub>(x)</em> is a quadric function. </center> <p>Josephina wonders the minimum of <em>F(x)</em>. Unfortunately, it's too hard for her to solve this problem. As a super programmer, can you help her? <h4>Input</h4> <p>The input contains multiple test cases. The first line is the number of cases <em>T</em> (<em>T</em> < 100). Each case begins with a number <em>n</em>(<em>n</em> ≤ 10000). Following <em>n</em> lines, each line contains three integers <em>a</em> (0 ≤ <em>a</em> ≤ 100), <em>b</em> (|<em>b</em>| ≤ 5000), <em>c</em> (|<em>c</em>| ≤ 5000), which mean the corresponding coefficients of a quadratic function. </p> <h4>Output</h4> <p>For each test case, output the answer in a line. Round to 4 digits after the decimal point. </p> <h4>Sample Input</h4> <pre>2 1 2 0 0 2 2 0 0 2 -4 2 </pre> <h4>Sample Output</h4> <pre>0.0000 0.5000 </pre> <pre>綆鏄庨鎰忥細姹備竴鍫?span style="COLOR: red">寮鍙e悜涓?/span>鐨勪簩嬈″嚱鏁板湪[0,1000]鑼冨洿涓婂嚱鏁板兼渶澶у肩殑鏈灝忓箋?/pre> <pre>浜屾鍑芥暟鐨勫瓙闆嗕粛鐒朵負鍑稿嚱鏁幫紝鎵浠ュ彲浠ョ敤涓夊垎娉曟眰鏋佸箋傜簿搴﹀疄鍦ㄥ緢铔嬬柤錛岃繖棰樿姹傚煎煙綺劇‘鍒?e-4錛屼絾鏄畾涔夊煙娌¤綺劇‘鍒板灝戯紝緇撴灉姝粀a錛屽崱鍒?e-10緇堜簬榪囦簡銆傘?/pre> <pre>璐翠唬鐮?/pre> <pre> <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"><span style="COLOR: #008080"> 1</span><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><span style="COLOR: #000000"># include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">cstdio</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"># include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">cmath</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n;<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> data[</span><span style="COLOR: #000000">10001</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"># define max(a,b) ((a)</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">(b)</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">(a):(b))<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> cal(</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> mid)<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img id=Codehighlighter1_144_270_Open_Image onclick="this.style.display='none'; Codehighlighter1_144_270_Open_Text.style.display='none'; Codehighlighter1_144_270_Closed_Image.style.display='inline'; Codehighlighter1_144_270_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_144_270_Closed_Image onclick="this.style.display='none'; Codehighlighter1_144_270_Closed_Text.style.display='none'; Codehighlighter1_144_270_Open_Image.style.display='inline'; Codehighlighter1_144_270_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_144_270_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_144_270_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">   </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> res</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">1e26;<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">   </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</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: #008080">11</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">     res</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">max(res,data[i][</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">mid</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">mid</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">data[i][</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">mid</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">data[i][</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]);<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">   </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> res;<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif">}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img id=Codehighlighter1_283_743_Open_Image onclick="this.style.display='none'; Codehighlighter1_283_743_Open_Text.style.display='none'; Codehighlighter1_283_743_Closed_Image.style.display='inline'; Codehighlighter1_283_743_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_283_743_Closed_Image onclick="this.style.display='none'; Codehighlighter1_283_743_Closed_Text.style.display='none'; Codehighlighter1_283_743_Open_Image.style.display='inline'; Codehighlighter1_283_743_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_283_743_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_283_743_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> test;<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    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">test);<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(test</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img id=Codehighlighter1_344_727_Open_Image onclick="this.style.display='none'; Codehighlighter1_344_727_Open_Text.style.display='none'; Codehighlighter1_344_727_Closed_Image.style.display='inline'; Codehighlighter1_344_727_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_344_727_Closed_Image onclick="this.style.display='none'; Codehighlighter1_344_727_Closed_Text.style.display='none'; Codehighlighter1_344_727_Open_Image.style.display='inline'; Codehighlighter1_344_727_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_344_727_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_344_727_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       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: #008080">21</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</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: #008080">22</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">         scanf(</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">data[i][</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">],</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">data[i][</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">],</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">data[i][</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]);<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> s</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0.0</span><span style="COLOR: #000000">,e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1000.0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> last</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s;<br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(fabs(e</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">s)</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">1e</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img id=Codehighlighter1_548_687_Open_Image onclick="this.style.display='none'; Codehighlighter1_548_687_Open_Text.style.display='none'; Codehighlighter1_548_687_Closed_Image.style.display='inline'; Codehighlighter1_548_687_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_548_687_Closed_Image onclick="this.style.display='none'; Codehighlighter1_548_687_Closed_Text.style.display='none'; Codehighlighter1_548_687_Open_Image.style.display='inline'; Codehighlighter1_548_687_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_548_687_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_548_687_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       <br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">         </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> m1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(s</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">e)</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">2.0</span><span style="COLOR: #000000">,m2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(m1</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">e)</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">2.0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">         </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(cal(m1)</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">cal(m2))<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">           e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">m2;<br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">         </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> <br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">           s</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">m1;<br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">       }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">       printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%.4lf\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,cal(e));<br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif">}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><br></span><span style="COLOR: #008080">39</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span></div> </pre> <img src ="http://www.shnenglu.com/yzhw/aggbug/133737.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yzhw/" target="_blank">yzhw</a> 2010-11-16 00:50 <a href="http://www.shnenglu.com/yzhw/archive/2010/11/16/133737.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>pku 1727 Advanced Causal Measurements (ACM) 浜屽垎+璐績鍙鎬у垽鏂?/title><link>http://www.shnenglu.com/yzhw/archive/2010/10/20/130505.html</link><dc:creator>yzhw</dc:creator><author>yzhw</author><pubDate>Tue, 19 Oct 2010 16:36:00 GMT</pubDate><guid>http://www.shnenglu.com/yzhw/archive/2010/10/20/130505.html</guid><wfw:comment>http://www.shnenglu.com/yzhw/comments/130505.html</wfw:comment><comments>http://www.shnenglu.com/yzhw/archive/2010/10/20/130505.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yzhw/comments/commentRss/130505.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yzhw/services/trackbacks/130505.html</trackback:ping><description><![CDATA[棰樼洰璇寸殑鏈夌偣璇″紓錛屼竴寮濮嬫病鎯沖埌浜屽垎錛屾兂鐩存帴閫氳繃鍗婂鉤闈氦鏉ヨВ鎴栬呮槸綰挎ц鍒掋傘傘?br>鎻忚堪涓嬮鐩鉤闈笂鏈変竴浜涚偣錛坸,t錛夛紙棰樼洰涓弿榪扮殑鏄?t,x)錛岀劧鍚巘鏄旱鍧愭爣錛屾湁鐐逛笉鑸掓湇錛夛紝鐒跺悗婊¤凍t2 >= t1+|x2-x1|鐨勭偣錛坱1,x1錛夌О涓虹偣(x2,t2)鐨勫墠瀵肩偣銆傜幇鍦ㄧ煡閬撳鉤闈㈢偣闆嗕互鍙婂叾鍓嶅鐐圭殑涓暟錛岄棶鍏跺墠瀵肩偣闆嗕腑t鐨勬渶澶у箋?br>鏍規嵁涓嶇瓑寮忥紝鍙互鍙戠幇姣忎釜鐐圭殑鍓嶅鐐歸泦鑼冨洿鏄竴涓互璇ョ偣涓洪《鐐圭殑涓夎褰㈠尯鍩燂紙鏍規嵁涓嶇瓑寮忕害鏉熺敾涓浘鐪嬬湅灝辨槑鐧戒簡錛夛紝鐒跺悗鍙互閫氳繃浜屽垎姹傚緱t錛屽叧浜庡垽鏂綋鍓峵鐨勫彲琛屾э紝灝嗘瘡涓偣琛ㄧず涓哄悎娉曞尯闂碵x2-(t2-t1),x2+t2-t1]錛岀劧鍚庢眰榪欎簺鍖洪棿鐨勬渶灝忚鐩栨暟錛堝氨鏄眰寰椾竴浜涘瓙鍖洪棿錛屼嬌寰楄繖浜涘瓙鍖洪棿鍖呭惈浜庡師鍖洪棿錛夈傝繖涓棶棰樺彲浠ラ氳繃璐績綆楁硶錛屼互鍖洪棿鍙崇鐐逛負絎竴鍏抽敭瀛楋紝宸︾鐐逛負絎簩鍏抽敭瀛楄繘琛屾帓搴忥紝鐒跺悗姣忔璐績鐨勯夋嫨褰撳墠鍖洪棿鐨勫彸绔偣浣滀負瀛愬尯闂達紝緇熻瑕佸鍑哄叏閮ㄥ尯闂撮渶瑕佸瓙鍖洪棿鐨勪釜鏁皀um銆?br>浠g爜濡備笅錛?br> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;"> 1</span> <span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.</span><span style="color: #000000;">*</span><span style="color: #000000;">;<br></span><span style="color: #008080;"> 2</span> <span style="color: #000000;"></span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Arrays;<br></span><span style="color: #008080;"> 3</span> <span style="color: #000000;"></span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> Main {<br></span><span style="color: #008080;"> 4</span> <span style="color: #000000;"><br></span><span style="color: #008080;"> 5</span> <span style="color: #000000;">    </span><span style="color: #008000;">/**</span><span style="color: #008000;"><br></span><span style="color: #008080;"> 6</span> <span style="color: #008000;">     * </span><span style="color: #808080;">@param</span><span style="color: #008000;"> args<br></span><span style="color: #008080;"> 7</span> <span style="color: #008000;">     </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br></span><span style="color: #008080;"> 8</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> StreamTokenizer in</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> StreamTokenizer(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> BufferedReader(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> InputStreamReader(System.in)));<br></span><span style="color: #008080;"> 9</span> <span style="color: #000000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">static StreamTokenizer in=new StreamTokenizer(new BufferedReader(new InputStreamReader(new FileInputStream("input.txt"))));</span><span style="color: #008000;"><br></span><span style="color: #008080;">10</span> <span style="color: #008000;"></span><span style="color: #000000;">    </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">final</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> readInt() </span><span style="color: #0000ff;">throws</span><span style="color: #000000;"> Exception<br></span><span style="color: #008080;">11</span> <span style="color: #000000;">    {<br></span><span style="color: #008080;">12</span> <span style="color: #000000;">        in.nextToken();<br></span><span style="color: #008080;">13</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;">)in.nval;<br></span><span style="color: #008080;">14</span> <span style="color: #000000;">    }<br></span><span style="color: #008080;">15</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> node </span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> Comparable</span><span style="color: #000000;"><</span><span style="color: #000000;">node</span><span style="color: #000000;">></span><span style="color: #000000;"><br></span><span style="color: #008080;">16</span> <span style="color: #000000;">    {<br></span><span style="color: #008080;">17</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> t,x,s,e;<br></span><span style="color: #008080;">18</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> compareTo(node pos)<br></span><span style="color: #008080;">19</span> <span style="color: #000000;">        {<br></span><span style="color: #008080;">20</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(e</span><span style="color: #000000;">!=</span><span style="color: #000000;">pos.e) </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> e</span><span style="color: #000000;">-</span><span style="color: #000000;">pos.e;<br></span><span style="color: #008080;">21</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">else</span><span style="color: #000000;"> </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> s</span><span style="color: #000000;">-</span><span style="color: #000000;">pos.s;<br></span><span style="color: #008080;">22</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">23</span> <span style="color: #000000;">    }<br></span><span style="color: #008080;">24</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> node data[]</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> node[</span><span style="color: #000000;">100005</span><span style="color: #000000;">];<br></span><span style="color: #008080;">25</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args) </span><span style="color: #0000ff;">throws</span><span style="color: #000000;"> Exception{<br></span><span style="color: #008080;">26</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> n</span><span style="color: #000000;">=</span><span style="color: #000000;">readInt();<br></span><span style="color: #008080;">27</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</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;">100005</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br></span><span style="color: #008080;">28</span> <span style="color: #000000;">            data[i]</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> node();<br></span><span style="color: #008080;">29</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> test</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;test</span><span style="color: #000000;"><=</span><span style="color: #000000;">n;test</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br></span><span style="color: #008080;">30</span> <span style="color: #000000;">        {<br></span><span style="color: #008080;">31</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> num</span><span style="color: #000000;">=</span><span style="color: #000000;">readInt(),limit</span><span style="color: #000000;">=</span><span style="color: #000000;">readInt(),e</span><span style="color: #000000;">=</span><span style="color: #000000;">4000000</span><span style="color: #000000;">,s</span><span style="color: #000000;">=-</span><span style="color: #000000;">4000000</span><span style="color: #000000;">;<br></span><span style="color: #008080;">32</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</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;">num;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br></span><span style="color: #008080;">33</span> <span style="color: #000000;">            {<br></span><span style="color: #008080;">34</span> <span style="color: #000000;">                data[i].t</span><span style="color: #000000;">=</span><span style="color: #000000;">readInt();<br></span><span style="color: #008080;">35</span> <span style="color: #000000;">                data[i].x</span><span style="color: #000000;">=</span><span style="color: #000000;">readInt();<br></span><span style="color: #008080;">36</span> <span style="color: #000000;">                e</span><span style="color: #000000;">=</span><span style="color: #000000;">Math.min(e, data[i].t);<br></span><span style="color: #008080;">37</span> <span style="color: #000000;">            }<br></span><span style="color: #008080;">38</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">while</span><span style="color: #000000;">(s</span><span style="color: #000000;"><=</span><span style="color: #000000;">e)<br></span><span style="color: #008080;">39</span> <span style="color: #000000;">            {<br></span><span style="color: #008080;">40</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> mid</span><span style="color: #000000;">=</span><span style="color: #000000;">(s</span><span style="color: #000000;">+</span><span style="color: #000000;">e)</span><span style="color: #000000;">>></span><span style="color: #000000;">1</span><span style="color: #000000;">,count</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">41</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</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;">num;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br></span><span style="color: #008080;">42</span> <span style="color: #000000;">                {<br></span><span style="color: #008080;">43</span> <span style="color: #000000;">                    data[i].s</span><span style="color: #000000;">=</span><span style="color: #000000;">data[i].x</span><span style="color: #000000;">-</span><span style="color: #000000;">data[i].t</span><span style="color: #000000;">+</span><span style="color: #000000;">mid;<br></span><span style="color: #008080;">44</span> <span style="color: #000000;">                    data[i].e</span><span style="color: #000000;">=</span><span style="color: #000000;">data[i].x</span><span style="color: #000000;">+</span><span style="color: #000000;">data[i].t</span><span style="color: #000000;">-</span><span style="color: #000000;">mid;<br></span><span style="color: #008080;">45</span> <span style="color: #000000;">                }<br></span><span style="color: #008080;">46</span> <span style="color: #000000;">                <br></span><span style="color: #008080;">47</span> <span style="color: #000000;">                Arrays.sort(data,</span><span style="color: #000000;">0</span><span style="color: #000000;">,num);<br></span><span style="color: #008080;">48</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> laste</span><span style="color: #000000;">=</span><span style="color: #000000;">data[</span><span style="color: #000000;">0</span><span style="color: #000000;">].e;<br></span><span style="color: #008080;">49</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</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;">num;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br></span><span style="color: #008080;">50</span> <span style="color: #000000;">                    </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(data[i].s</span><span style="color: #000000;"><=</span><span style="color: #000000;">laste)<br></span><span style="color: #008080;">51</span> <span style="color: #000000;">                        </span><span style="color: #0000ff;">continue</span><span style="color: #000000;">;<br></span><span style="color: #008080;">52</span> <span style="color: #000000;">                    </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br></span><span style="color: #008080;">53</span> <span style="color: #000000;">                    {<br></span><span style="color: #008080;">54</span> <span style="color: #000000;">                        count</span><span style="color: #000000;">++</span><span style="color: #000000;">;<br></span><span style="color: #008080;">55</span> <span style="color: #000000;">                        laste</span><span style="color: #000000;">=</span><span style="color: #000000;">data[i].e;<br></span><span style="color: #008080;">56</span> <span style="color: #000000;">                    }<br></span><span style="color: #008080;">57</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(count</span><span style="color: #000000;"><=</span><span style="color: #000000;">limit)<br></span><span style="color: #008080;">58</span> <span style="color: #000000;">                    s</span><span style="color: #000000;">=</span><span style="color: #000000;">mid</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">59</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br></span><span style="color: #008080;">60</span> <span style="color: #000000;">                    e</span><span style="color: #000000;">=</span><span style="color: #000000;">mid</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">61</span> <span style="color: #000000;">            }<br></span><span style="color: #008080;">62</span> <span style="color: #000000;">            System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">Case </span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">test</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;">+</span><span style="color: #000000;">e);            <br></span><span style="color: #008080;">63</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">64</span> <span style="color: #000000;"><br></span><span style="color: #008080;">65</span> <span style="color: #000000;">    }<br></span><span style="color: #008080;">66</span> <span style="color: #000000;"><br></span><span style="color: #008080;">67</span> <span style="color: #000000;">}<br></span><span style="color: #008080;">68</span> <span style="color: #000000;"></span></div> <br><img src ="http://www.shnenglu.com/yzhw/aggbug/130505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yzhw/" target="_blank">yzhw</a> 2010-10-20 00:36 <a href="http://www.shnenglu.com/yzhw/archive/2010/10/20/130505.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>pku 1176 Party Lampshttp://www.shnenglu.com/yzhw/archive/2010/10/19/130434.htmlyzhwyzhwTue, 19 Oct 2010 06:17:00 GMThttp://www.shnenglu.com/yzhw/archive/2010/10/19/130434.htmlhttp://www.shnenglu.com/yzhw/comments/130434.htmlhttp://www.shnenglu.com/yzhw/archive/2010/10/19/130434.html#Feedback0http://www.shnenglu.com/yzhw/comments/commentRss/130434.htmlhttp://www.shnenglu.com/yzhw/services/trackbacks/130434.html闃呰鍏ㄦ枃

yzhw 2010-10-19 14:17 鍙戣〃璇勮
]]>
pku 1855 Mint 姹?涓暟鐨勬渶灝忓叕鍊嶆暟錛屾鍑犻噷寰楃畻娉?/title><link>http://www.shnenglu.com/yzhw/archive/2010/10/12/129663.html</link><dc:creator>yzhw</dc:creator><author>yzhw</author><pubDate>Tue, 12 Oct 2010 15:01:00 GMT</pubDate><guid>http://www.shnenglu.com/yzhw/archive/2010/10/12/129663.html</guid><wfw:comment>http://www.shnenglu.com/yzhw/comments/129663.html</wfw:comment><comments>http://www.shnenglu.com/yzhw/archive/2010/10/12/129663.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yzhw/comments/commentRss/129663.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yzhw/services/trackbacks/129663.html</trackback:ping><description><![CDATA[棰樼洰寰堥暱錛屽氨鏄鐢ㄤ粠n縐嶇‖甯佷腑閫夊彇4縐嶄笉鍚岀殑紜竵鍫嗗彔璧鋒潵錛屼綔涓烘瀛愮殑鍥涗釜鑵匡紝鏄劇劧錛屾瀛愮殑鍥涗釜鑵胯鐩哥瓑銆傞棶瀵逛簬涓涓粰瀹氱殑楂樺害h錛岀‖甯佽兘澶熷爢鎴愮殑涓嶅ぇ浜巋鐨勬渶澶ч珮搴﹀拰涓嶅皬浜巋鐨勬渶灝忛珮搴﹀垎鍒負澶氬皯錛?br>搴斾負鏁版嵁涓嶅ぇ錛?n涓?0宸﹀彸錛屽彲浠ョ敤4涓猣or寰幆鏉ユ灇涓劇‖甯侊紝鍋囪鍥涚紜竵涓篴銆乥銆乧銆乨錛屾眰鐨勮繖鍥涗釜鏁扮殑鏈灝忓叕鍊嶆暟鍗沖彲錛岀劧鍚庡氨鐢ㄦ鍑犻噷寰楃畻娉曡В鍐熾?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"><span style="COLOR: #008080"> 1</span><img id=Codehighlighter1_0_105_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_105_Open_Text.style.display='none'; Codehighlighter1_0_105_Closed_Image.style.display='inline'; Codehighlighter1_0_105_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_0_105_Closed_Image onclick="this.style.display='none'; Codehighlighter1_0_105_Closed_Text.style.display='none'; Codehighlighter1_0_105_Open_Image.style.display='inline'; Codehighlighter1_0_105_Open_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif"><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_0_105_Closed_Text>/**/</span><span id=Codehighlighter1_0_105_Open_Text><span style="COLOR: #008000">/*</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">Source Code<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">Problem: 1855  User: yzhw <br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">Memory: 8648K  Time: 313MS <br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">Language: G++  Result: Accepted <br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif"></span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"># include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"># include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">cstdio</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> l[</span><span style="COLOR: #000000">51</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> refer[</span><span style="COLOR: #000000">51</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">51</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">51</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">51</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> gcd(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> b)<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img id=Codehighlighter1_229_285_Open_Image onclick="this.style.display='none'; Codehighlighter1_229_285_Open_Text.style.display='none'; Codehighlighter1_229_285_Closed_Image.style.display='inline'; Codehighlighter1_229_285_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_229_285_Closed_Image onclick="this.style.display='none'; Codehighlighter1_229_285_Closed_Text.style.display='none'; Codehighlighter1_229_285_Open_Image.style.display='inline'; Codehighlighter1_229_285_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_229_285_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_229_285_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(b)<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img id=Codehighlighter1_242_272_Open_Image onclick="this.style.display='none'; Codehighlighter1_242_272_Open_Text.style.display='none'; Codehighlighter1_242_272_Closed_Image.style.display='inline'; Codehighlighter1_242_272_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_242_272_Closed_Image onclick="this.style.display='none'; Codehighlighter1_242_272_Closed_Text.style.display='none'; Codehighlighter1_242_272_Open_Image.style.display='inline'; Codehighlighter1_242_272_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_242_272_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_242_272_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> t</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">b;<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        a</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">b;<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        b</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">t;<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> a;<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif">}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img id=Codehighlighter1_298_1294_Open_Image onclick="this.style.display='none'; Codehighlighter1_298_1294_Open_Text.style.display='none'; Codehighlighter1_298_1294_Closed_Image.style.display='inline'; Codehighlighter1_298_1294_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_298_1294_Closed_Image onclick="this.style.display='none'; Codehighlighter1_298_1294_Closed_Text.style.display='none'; Codehighlighter1_298_1294_Open_Image.style.display='inline'; Codehighlighter1_298_1294_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_298_1294_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_298_1294_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n,t;<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img id=Codehighlighter1_324_1281_Open_Image onclick="this.style.display='none'; Codehighlighter1_324_1281_Open_Text.style.display='none'; Codehighlighter1_324_1281_Closed_Image.style.display='inline'; Codehighlighter1_324_1281_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_324_1281_Closed_Image onclick="this.style.display='none'; Codehighlighter1_324_1281_Closed_Text.style.display='none'; Codehighlighter1_324_1281_Open_Image.style.display='inline'; Codehighlighter1_324_1281_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_324_1281_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_324_1281_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        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">t);<br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">if</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">t) </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</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: #008080">33</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,l</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">i);<br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;a</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;a</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;b</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;b</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">if(a!=b)</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">37</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"></span><span style="COLOR: #000000">                                    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;c</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;c</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">if(a!=c&&b!=c)</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">39</span><span style="COLOR: #008000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"></span><span style="COLOR: #000000">                                        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;d</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;d</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">40</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">if(a!=d&&b!=d&&c!=d)</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">41</span><span style="COLOR: #008000"><img id=Codehighlighter1_623_795_Open_Image onclick="this.style.display='none'; Codehighlighter1_623_795_Open_Text.style.display='none'; Codehighlighter1_623_795_Closed_Image.style.display='inline'; Codehighlighter1_623_795_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_623_795_Closed_Image onclick="this.style.display='none'; Codehighlighter1_623_795_Closed_Text.style.display='none'; Codehighlighter1_623_795_Open_Image.style.display='inline'; Codehighlighter1_623_795_Open_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif"></span><span style="COLOR: #000000">                                            </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_623_795_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_623_795_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">42</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                                </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> lcd1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">l[a]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">l[b]</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">gcd(l[a],l[b]),lcd2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">l[c]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">l[d]</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">gcd(l[c],l[d]);<br></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                                </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> lcd</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">lcd1</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">lcd2</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">gcd(lcd1,lcd2);<br></span><span style="COLOR: #008080">44</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                                refer[a][b][c][d]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">lcd;<br></span><span style="COLOR: #008080">45</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">46</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">                                            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">47</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">48</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">        </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(t</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">49</span><span style="COLOR: #000000"><img id=Codehighlighter1_813_1278_Open_Image onclick="this.style.display='none'; Codehighlighter1_813_1278_Open_Text.style.display='none'; Codehighlighter1_813_1278_Closed_Image.style.display='inline'; Codehighlighter1_813_1278_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_813_1278_Closed_Image onclick="this.style.display='none'; Codehighlighter1_813_1278_Closed_Text.style.display='none'; Codehighlighter1_813_1278_Open_Image.style.display='inline'; Codehighlighter1_813_1278_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_813_1278_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_813_1278_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">50</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> minnum</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0xfffffff</span><span style="COLOR: #000000">,maxnum</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">51</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> pos;<br></span><span style="COLOR: #008080">52</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            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">pos);<br></span><span style="COLOR: #008080">53</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;a</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;a</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">54</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;b</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;b</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">55</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;c</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;c</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">56</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</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">1</span><span style="COLOR: #000000">;d</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;d</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">57</span><span style="COLOR: #000000"><img id=Codehighlighter1_998_1237_Open_Image onclick="this.style.display='none'; Codehighlighter1_998_1237_Open_Text.style.display='none'; Codehighlighter1_998_1237_Closed_Image.style.display='inline'; Codehighlighter1_998_1237_Closed_Text.style.display='inline';" align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="DISPLAY: none" id=Codehighlighter1_998_1237_Closed_Image onclick="this.style.display='none'; Codehighlighter1_998_1237_Closed_Text.style.display='none'; Codehighlighter1_998_1237_Open_Image.style.display='inline'; Codehighlighter1_998_1237_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_998_1237_Closed_Text><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_998_1237_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">58</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">59</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> lcd</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">refer[a][b][c][d];<br></span><span style="COLOR: #008080">60</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(pos</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">pos</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">maxnum)<br></span><span style="COLOR: #008080">61</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                    maxnum</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">pos</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">pos</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">lcd;<br></span><span style="COLOR: #008080">62</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(pos</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(pos</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">lcd</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">minnum)<br></span><span style="COLOR: #008080">63</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                    minnum</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(pos</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">64</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(pos</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">lcd</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">pos</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">minnum)<br></span><span style="COLOR: #008080">65</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">                                    minnum</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">pos;<br></span><span style="COLOR: #008080">66</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif"><br></span><span style="COLOR: #008080">67</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">                            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">68</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">            printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d %d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,maxnum,minnum);<br></span><span style="COLOR: #008080">69</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">70</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif">    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">71</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif">    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">72</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif">}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">73</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"><br></span><span style="COLOR: #008080">74</span><span style="COLOR: #000000"><img align=top src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif"></span></div> <img src ="http://www.shnenglu.com/yzhw/aggbug/129663.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yzhw/" target="_blank">yzhw</a> 2010-10-12 23:01 <a href="http://www.shnenglu.com/yzhw/archive/2010/10/12/129663.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.9yyg.cn" target="_blank">91精品国产高清91久久久久久</a>| <a href="http://www.jfjn.net.cn" target="_blank">精品久久久无码中文字幕天天</a>| <a href="http://www.acmpm.cn" target="_blank">国产精品久久久久久久久久免费</a>| <a href="http://www.pingpangq.cn" target="_blank">久久天天躁狠狠躁夜夜avapp</a>| <a href="http://www.n24657.cn" target="_blank">伊人久久大香线蕉精品不卡</a>| <a href="http://www.iteethle.cn" target="_blank">久久人人爽人人爽AV片</a>| <a href="http://www.024qixinyu.cn" target="_blank">精品久久久久久无码免费</a>| <a href="http://www.smsunion.cn" target="_blank">品成人欧美大片久久国产欧美</a>| <a href="http://www.csrjgzs.cn" target="_blank">久久精品国产亚洲一区二区</a>| <a href="http://www.lhstrip.cn" target="_blank">久久免费线看线看</a>| <a href="http://www.ezchem.cn" target="_blank">91秦先生久久久久久久</a>| <a href="http://www.splh.net.cn" target="_blank">久久精品国产一区二区</a>| <a href="http://www.97xxri.cn" target="_blank">伊人久久精品影院</a>| <a href="http://www.7trade.cn" target="_blank">久久精品国产男包</a>| <a href="http://www.henpu.cn" target="_blank">91精品国产乱码久久久久久</a>| <a href="http://www.zgyuantong.com.cn" target="_blank">国产精品久久久福利</a>| <a href="http://www.76xp.cn" target="_blank">久久精品国产黑森林</a>| <a href="http://www.ojh365ok123.com.cn" target="_blank">久久影视国产亚洲</a>| <a href="http://www.3gdd.cn" target="_blank">浪潮AV色综合久久天堂</a>| <a href="http://www.gdlj2004.cn" target="_blank">91麻豆精品国产91久久久久久</a>| <a href="http://www.lq03.cn" target="_blank">久久精品国产亚洲一区二区三区</a>| <a href="http://www.tyo8.cn" target="_blank">人妻无码精品久久亚瑟影视</a>| <a href="http://www.85062.com.cn" target="_blank">久久久久人妻一区精品色</a>| <a href="http://www.ebuxy.cn" target="_blank">热99re久久国超精品首页</a>| <a href="http://www.gaguni.cn" target="_blank">久久综合一区二区无码</a>| <a href="http://www.sxttzs.cn" target="_blank">亚洲精品蜜桃久久久久久</a>| <a href="http://www.kbqst.cn" target="_blank">久久精品国产秦先生</a>| <a href="http://www.91pang.cn" target="_blank">久久天天躁狠狠躁夜夜av浪潮</a>| <a href="http://www.laqn.cn" target="_blank">一本久久a久久精品亚洲</a>| <a href="http://www.alilinfen.cn" target="_blank">精品久久久久久中文字幕</a>| <a href="http://www.xqt007.cn" target="_blank">亚洲人成无码www久久久</a>| <a href="http://www.woai858.cn" target="_blank">久久久无码一区二区三区</a>| <a href="http://www.bushenba.cn" target="_blank">久久精品国产国产精品四凭</a>| <a href="http://www.cfgcurn.cn" target="_blank">日韩AV无码久久一区二区</a>| <a href="http://www.i231.cn" target="_blank">久久国产精品一区</a>| <a href="http://www.cdz8.cn" target="_blank">国产三级久久久精品麻豆三级 </a>| <a href="http://www.51fsyf.cn" target="_blank">久久精品九九亚洲精品</a>| <a href="http://www.4fro.cn" target="_blank">久久激情亚洲精品无码?V</a>| <a href="http://www.allevery.cn" target="_blank">久久人人爽人人爽人人片av高请 </a>| <a href="http://www.six-dream.cn" target="_blank">综合久久久久久中文字幕亚洲国产国产综合一区首 </a>| <a href="http://www.ekqz.cn" target="_blank">久久综合视频网</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>