锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久电影网2021,国产精品美女久久久久AV福利,日韩欧美亚洲国产精品字幕久久久http://www.shnenglu.com/codepeng/zh-cnThu, 08 May 2025 19:47:46 GMTThu, 08 May 2025 19:47:46 GMT60fzu OJ Problem 2064 鎵句綅緗?/title><link>http://www.shnenglu.com/codepeng/archive/2011/12/13/162057.html</link><dc:creator>acpeng</dc:creator><author>acpeng</author><pubDate>Tue, 13 Dec 2011 14:06:00 GMT</pubDate><guid>http://www.shnenglu.com/codepeng/archive/2011/12/13/162057.html</guid><wfw:comment>http://www.shnenglu.com/codepeng/comments/162057.html</wfw:comment><comments>http://www.shnenglu.com/codepeng/archive/2011/12/13/162057.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/codepeng/comments/commentRss/162057.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/codepeng/services/trackbacks/162057.html</trackback:ping><description><![CDATA[鍙堝埛涓閬撴按棰橈紝鍦板潃錛?a >http://acm.fzu.edu.cn/problem.php?pid=2064</a><br /><br />鍐呭涓嶅榪幫紝鐩存帴code <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><img id="Code_Closed_Image_220528" onclick="this.style.display='none'; Code_Closed_Text_220528.style.display='none'; Code_Open_Image_220528.style.display='inline'; Code_Open_Text_220528.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" height="16"><img style="display: none" id="Code_Open_Image_220528" onclick="this.style.display='none'; Code_Open_Text_220528.style.display='none'; Code_Closed_Image_220528.style.display='inline'; Code_Closed_Text_220528.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" height="16"><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Code_Closed_Text_220528"></span><span style="display: none" id="Code_Open_Text_220528"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000">#include</span><span style="color: #000000"><</span><span style="color: #000000">stdio.h</span><span style="color: #000000">></span><span style="color: #000000"><br /></span><span style="color: #0000ff">int</span><span style="color: #000000"> data[</span><span style="color: #000000">103</span><span style="color: #000000">][</span><span style="color: #000000">103</span><span style="color: #000000">];<br /></span><span style="color: #0000ff">int</span><span style="color: #000000"> flg_1,flg_2;<br /></span><span style="color: #008000">//</span><span style="color: #008000">鎼滅儲data[i][j] ~ data[i][j+w-1],鑻ョ鍚堬紝榪斿洖1;鍚﹀垯榪斿洖0錛宖lg_1涓烘渶鍚庝竴涓?鐨勪綅緗?/span><span style="color: #008000"><br /></span><span style="color: #0000ff">int</span><span style="color: #000000"> search(</span><span style="color: #0000ff">int</span><span style="color: #000000"> a[],</span><span style="color: #0000ff">int</span><span style="color: #000000"> j,</span><span style="color: #0000ff">int</span><span style="color: #000000"> w)<br />{<br />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i;<br />    </span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">j</span><span style="color: #000000">+</span><span style="color: #000000">w</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">j;i</span><span style="color: #000000">--</span><span style="color: #000000">)<br />    {<br />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(a[i]</span><span style="color: #000000">!=</span><span style="color: #000000">0</span><span style="color: #000000">)<br />        {<br />            flg_1</span><span style="color: #000000">=</span><span style="color: #000000">i;<br />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br />        }<br />    }<br />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br />}<br /></span><span style="color: #008000">//</span><span style="color: #008000">鎵懼嚭data鏁版嵁絎?nbsp;i 琛宒ata[i][j]涔嬪悗鐨勭涓涓?鐨勪綅緗紝榪斿洖涔嬮棿鐨?鐨勪釜鏁?/span><span style="color: #008000"><br /></span><span style="color: #0000ff">int</span><span style="color: #000000"> find1behind(</span><span style="color: #0000ff">int</span><span style="color: #000000"> a[],</span><span style="color: #0000ff">int</span><span style="color: #000000"> j,</span><span style="color: #0000ff">int</span><span style="color: #000000"> m)<br />{<br />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i,cont</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br />    </span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;j</span><span style="color: #000000">+</span><span style="color: #000000">i</span><span style="color: #000000"><=</span><span style="color: #000000">m;j</span><span style="color: #000000">++</span><span style="color: #000000">)<br />    {<br />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(a[j</span><span style="color: #000000">+</span><span style="color: #000000">i]</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)cont</span><span style="color: #000000">++</span><span style="color: #000000">;<br />        </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">break</span><span style="color: #000000">;<br />    }<br />    flg_2</span><span style="color: #000000">=</span><span style="color: #000000">j</span><span style="color: #000000">+</span><span style="color: #000000">i;<br />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> cont;<br />}<br /></span><span style="color: #0000ff">int</span><span style="color: #000000"> main()<br />{<br />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> T,N,M,W,i,j,tmp,cont;<br />    scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&</span><span style="color: #000000">T);<br />    </span><span style="color: #0000ff">while</span><span style="color: #000000">(T</span><span style="color: #000000">--</span><span style="color: #000000">)<br />    {<br />        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">N,</span><span style="color: #000000">&</span><span style="color: #000000">M,</span><span style="color: #000000">&</span><span style="color: #000000">W);<br />        </span><span style="color: #0000ff">for</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: #0000ff">for</span><span style="color: #000000">(j</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;j</span><span style="color: #000000"><</span><span style="color: #000000">M;j</span><span style="color: #000000">++</span><span style="color: #000000">)<br />                scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&</span><span style="color: #000000">data[i][j]);<br />        cont</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">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 />        {<br />            </span><span style="color: #0000ff">for</span><span style="color: #000000">(j</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;j</span><span style="color: #000000"><=</span><span style="color: #000000">M</span><span style="color: #000000">-</span><span style="color: #000000">W;j</span><span style="color: #000000">++</span><span style="color: #000000">)<br />            {<br />                tmp</span><span style="color: #000000">=</span><span style="color: #000000">search(data[i],j,W);<br />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(tmp</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)<br />                {<br />                    j</span><span style="color: #000000">=</span><span style="color: #000000">flg_1;<br />                }<br />                </span><span style="color: #0000ff">else</span><span style="color: #000000"><br />                {<br />                    cont</span><span style="color: #000000">++</span><span style="color: #000000">;<br />                    cont</span><span style="color: #000000">+=</span><span style="color: #000000">find1behind(data[i],j</span><span style="color: #000000">+</span><span style="color: #000000">W,M</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">);<br />                    j</span><span style="color: #000000">=</span><span style="color: #000000">flg_2;<br />                }<br />            }<br />        }<br />        printf(</span><span style="color: #000000">"</span><span style="color: #000000">%d\n</span><span style="color: #000000">"</span><span style="color: #000000">,cont);<br />    }<br />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br />}</span></span></div><br /><br /><img src ="http://www.shnenglu.com/codepeng/aggbug/162057.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/codepeng/" target="_blank">acpeng</a> 2011-12-13 22:06 <a href="http://www.shnenglu.com/codepeng/archive/2011/12/13/162057.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>HDU 2084 鏁板http://www.shnenglu.com/codepeng/archive/2011/10/03/157404.htmlacpengacpengMon, 03 Oct 2011 04:16:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/10/03/157404.htmlhttp://www.shnenglu.com/codepeng/comments/157404.htmlhttp://www.shnenglu.com/codepeng/archive/2011/10/03/157404.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/157404.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/157404.htmlhttp://acm.hdu.edu.cn/showproblem.php?pid=2084


緇忓吀鍏ラ棬綰P錛岃嚜搴曞悜涓婏紝灞傚眰閫掕繘銆傦紙鎵璋撶殑璁板繂鍖栨悳绱級
#include<stdio.h>
#define max(a,b) (a)>(b)?(a):(b)
int a[103][103];
int main()
{
    
int t,n,i,j;
    scanf(
"%d",&t);
    
while(t--)
    {
        scanf(
"%d",&n);
        
for(i=0;i<n;i++)
            
for(j=0;j<=i;j++)
                scanf(
"%d",&a[i][j]);
        
for(i=n-1;i>0;i--)
            
for(j=0;j<i;j++)
                a[i
-1][j]+=max(a[i][j],a[i][j+1]);
        printf(
"%d\n",a[0][0]);
    }
    
return 0;
}



acpeng 2011-10-03 12:16 鍙戣〃璇勮
]]>
HDU 1160 ZOJ 1108 FatMouse's Speedhttp://www.shnenglu.com/codepeng/archive/2011/10/03/157386.htmlacpengacpengSun, 02 Oct 2011 19:24:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/10/03/157386.htmlhttp://www.shnenglu.com/codepeng/comments/157386.htmlhttp://www.shnenglu.com/codepeng/archive/2011/10/03/157386.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/157386.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/157386.html棰樼洰閾炬帴錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1160
Problem Description
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speeds are decreasing.
 
Input
Input contains data for a bunch of mice, one mouse per line, terminated by end of file.
The data for a particular mouse will consist of a pair of integers: the first representing its size in grams and the second representing its speed in centimeters per second. Both integers are between 1 and 10000. The data in each test case will contain information for at most 1000 mice.
Two mice may have the same weight, the same speed, or even the same weight and speed.
Output
Your program should output a sequence of lines of data; the first line should contain a number n; the remaining n lines should each contain a single positive integer (each one representing a mouse). If these n integers are m[1], m[2],..., m[n] then it must be the case that

W[m[1]] < W[m[2]] < ... < W[m[n]]

and

S[m[1]] > S[m[2]] > ... > S[m[n]]

In order for the answer to be correct, n should be as large as possible.
All inequalities are strict: weights must be strictly increasing, and speeds must be strictly decreasing. There may be many correct outputs for a given input, your program only needs to find one.
 
Sample Input
6008 1300 6000 2100 500 2000 1000 4000 1100 3000 6000 2000 8000 1400 6000 1200 2000 1900




Sample Output
4 4 5 9 7
瑙i鎬?/span>璺細
棣栧厛鏍規嵁weight鐨勬暟鍊肩敱灝忓埌澶ф帓搴忥紝鐒跺悗鍐嶄互speed涓烘爣鍑嗭紝姹傛渶闀夸笅闄嶅瓙搴忓垪錛屾濊礬榪樻槸DP錛屼絾鏄鏍囪瀛愬簭鍒楃殑涓嬫爣
楹葷儲澶氫簡錛屾垜鐨勫仛娉曪細
瀹氫箟MaxIncludeEnd鏁扮粍錛屼護MaxIncludeEnd[i]琛ㄧず浠[i]緇撳熬鐨勬渶闀夸笅闄嶅瓙搴忓垪鐨勯暱搴︼紝閭d箞
MaxIncludeEnd[i]=max{ MaxIncludeEnd[i] , a[j]>a[i] ? (MaxIncludeEnd[j]+1) 錛?1; }
鍏朵腑j=0:i-1;MaxIncludeEnd[i]鐨勫垵濮嬪間負1,姣忎竴涓猧緇撴潫鍚庣敤max鍜孧axIncludeEnd[i]姣旇緝錛屾洿鏂癿ax鍜屼笅鏍噈ax_flg銆?/span>
鍥犱負瑕佹爣璁頒笅鏍囷紝鍦ㄨ綆桵axIncludeEnd[i]鍚庯紝鐢╢lg[i]琛ㄧず浠[i]緇撳熬鐨勬渶闀夸笅闄嶅瓙搴忓垪鐨勫墠涓涓厓绱犵殑涓嬫爣錛岃繖鏍瘋綆楀畬
MaxIncludeEnd[n]騫舵洿鏂板畬max鍜宮ax_flg浠ュ悗錛屽驚鐜掓帹涓嬈″氨鍙互寰楀埌鎵鏈夌殑鍏冪礌涓嬫爣錛屽嵆flg[max_flg],flg[ flg[max_flg] ],……
褰撶劧榪欓噷鐨勪笅鏍囨槸閫嗗悜鐨勶紝瑕佽緗釜鏂扮殑鏁扮粍鏉ュ皢鍏墮嗚漿銆?/span>
ps錛氬鏋滀粠鍚庡線鍓嶈綆楁渶闀夸笂鍗囧瓙搴忓垪錛岄偅灝變笉蹇呭姝ら夯鐑︼紝鍑忓皯絀洪棿銆?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">code





acpeng 2011-10-03 03:24 鍙戣〃璇勮
]]>
HDU 1087 Super Jumpinghttp://www.shnenglu.com/codepeng/archive/2011/10/03/157380.htmlacpengacpengSun, 02 Oct 2011 17:28:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/10/03/157380.htmlhttp://www.shnenglu.com/codepeng/comments/157380.htmlhttp://www.shnenglu.com/codepeng/archive/2011/10/03/157380.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/157380.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/157380.html棰樼洰閾炬帴錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1087
Problem Description
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.


The game can be played by two or more than two players. It consists of a chessboard錛堟鐩橈級and some chessmen錛堟瀛愶級, and all chessmen are marked by a positive integer or “start” or “end”. The player starts from start-point and must jumps into end-point finally. In the course of jumping, the player will visit the chessmen in the path, but everyone must jumps from one chessman to another absolutely bigger (you can assume start-point is a minimum and end-point is a maximum.). And all players cannot go backwards. One jumping can go from a chessman to next, also can go across many chessmen, and even you can straightly get to end-point from start-point. Of course you get zero point in this situation. A player is a winner if and only if he can get a bigger score according to his jumping solution. Note that your score comes from the sum of value on the chessmen in you jumping path.
Your task is to output the maximum value according to the given chessmen list.
Input
Input contains multiple test cases. Each test case is described in a line as follow:
N value_1 value_2 …value_N
It is guarantied that N is not more than 1000 and all value_i are in the range of 32-int.
A test case starting with 0 terminates the input and this test case is not to be processed.
Output
For each case, print the maximum according to rules, and one line one case.

Sample Input
3 1 3 2 4 1 2 3 4 4 3 3 2 1 0
Sample Output
4 10 3













鍏稿瀷鐨勫叆闂ㄧ駭DP棰橈紝瑙i鎬濊礬錛?br />瀹氫箟MaxIncludeEnd鏁扮粍錛屼護MaxIncludeEnd[i]琛ㄧず浠[i]緇撳熬鐨勬渶澶у拰錛岄偅涔?br />MaxIncludeEnd[i]=max{ MaxIncludeEnd[i] , a[j]<a[i] ? (MaxIncludeEnd[j]+a[i]) 錛?1; }
鍏朵腑j=0 to i-1;MaxIncludeEnd[i]鐨勫垵濮嬪間負a[i]銆?br />
#include<stdio.h>
int a[1003],MaxIncludeEnd[1003];
int main()
{
    
int n,max,i,j;
    
while(scanf("%d",&n),n)
    
{
        
for(i=0;i<n;i++)
        
{
            scanf(
"%d",&a[i]);
            MaxIncludeEnd[i]
=a[i];
        }

        max
=MaxIncludeEnd[0];
        
for(i=0;i<n;i++)
        
{
            
for(j=0;j<i;j++)
            
{
                
if(a[j]<a[i] && MaxIncludeEnd[j]+a[i]>MaxIncludeEnd[i])
                    MaxIncludeEnd[i]
=MaxIncludeEnd[j]+a[i];
            }

            
if(max<MaxIncludeEnd[i])max=MaxIncludeEnd[i];
        }

        printf(
"%d\n",max);
    }

    
return 0;
}





acpeng 2011-10-03 01:28 鍙戣〃璇勮
]]>
ZOJ1292 , HDU 1047 Integer Inquiryhttp://www.shnenglu.com/codepeng/archive/2011/09/05/155171.htmlacpengacpengMon, 05 Sep 2011 15:22:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/09/05/155171.htmlhttp://www.shnenglu.com/codepeng/comments/155171.htmlhttp://www.shnenglu.com/codepeng/archive/2011/09/05/155171.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/155171.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/155171.html澶ф暟鐩稿姞錛屽瓧絎︽ā鎷?br />棰樼洰閾炬帴錛?br />ZOJ錛?a >http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1292
HDU錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1047

Description
One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.

``This supercomputer is great,'' remarked Chip. ``I only wish Timothy were here to see these results.'' (Chip moved to a new apartment, once one became available on the third floor of the Lemon Sky apartments on Third Street.)


Input
The input will consist of at most 100 lines of text, each of which contains a single VeryLongInteger. Each VeryLongInteger will be 100 or fewer characters in length, and will only contain digits (no VeryLongInteger will be negative).

The final input line will contain a single zero on a line by itself.


Output
Your program should output the sum of the VeryLongIntegers given in the input.


This problem contains multiple test cases!

The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

The output format consists of N output blocks. There is a blank line between output blocks.


Sample Input

1

123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
0


Sample Output

370370367037037036703703703670

AC浠g爜錛?/p>

/*
Accepted 1047 0MS 188K 1256 B C++ 
*/

#include
<stdio.h>
#include
<string.h>
#define MaxSize 1000
void FunBigAdd(char *str1,char *str2);
int main()
{
    
char IntStr[MaxSize]="\0",str[MaxSize]="\0";
    
int T,i;
    scanf(
"%d",&T);
    
while(T--)
    
{
        memset(str,
0,MaxSize);
        scanf(
"%s",IntStr);
        
while(strcmp(IntStr,"0")!=0)
        
{
            FunBigAdd(str,IntStr);
            memset(IntStr,
0,MaxSize);
            scanf(
"%s",IntStr);
        }

        i
=0;
        
while(str[i]=='0' && str[i]!='\0')i++;
        
if(str[i]=='\0')printf("0\n");
        
else printf("%s\n",str+i);
        
if(T!=0)printf("\n");
    }

    
return 0;
}

void strRevg(char *str)
{
    
int i;char temp;
    
int lgth=(int)strlen(str)-1;
    
for(i=0;i<lgth-i;i++)
    
{
        temp
=*(str+i);
        
*(str+i)=*(str+lgth-i);
        
*(str+lgth-i)=temp;
    }

}

void FunBigAdd(char *str1,char *str2)
{    
    
int i=0,dec=0,tmp;
    strRevg(str1);
    strRevg(str2);
    
while(*(str1+i)!='\0' || *(str2+i)!='\0')
    
{
        
if(*(str1+i)=='\0')
        
{
            
*(str1+i)='0';
            
*(str1+i+1)='\0';
        }

        
if(*(str2+i)=='\0')
        
{
            
*(str2+i)='0';
            
*(str2+i+1)='\0';
        }

        tmp
=*(str1+i)-'0'+(*(str2+i)-'0')+dec;
        
*(str1+i)=tmp%10+'0';
        dec
=tmp/10;
        i
++;
    }

    
if(dec!=0*(str1+(i++))=dec+'0';
    
*(str1+i)='\0';
    strRevg(str1);
}





acpeng 2011-09-05 23:22 鍙戣〃璇勮
]]>
ZOJ 1061 Web Navigation_鏁版嵁緇撴瀯_鏍?/title><link>http://www.shnenglu.com/codepeng/archive/2011/09/05/155165.html</link><dc:creator>acpeng</dc:creator><author>acpeng</author><pubDate>Mon, 05 Sep 2011 14:47:00 GMT</pubDate><guid>http://www.shnenglu.com/codepeng/archive/2011/09/05/155165.html</guid><wfw:comment>http://www.shnenglu.com/codepeng/comments/155165.html</wfw:comment><comments>http://www.shnenglu.com/codepeng/archive/2011/09/05/155165.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/codepeng/comments/commentRss/155165.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/codepeng/services/trackbacks/155165.html</trackback:ping><description><![CDATA[<a >http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=61</a><br />鏁版嵁緇撴瀯錛岀敤C鍐欑殑鏍堬紝涓嶇敤STL紜疄澶嶆潅澶氫簡錛學A浜嗗嚑嬈<br />Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be reached by moving backward and forward. In this problem, you are asked to implement this. <p>The following commands need to be supported:</p> <p><strong>BACK</strong>: Push the current page on the top of the forward stack. Pop the page from the top of the backward stack, making it the new current page. If the backward stack is empty, the command is ignored.</p> <p><strong>FORWARD</strong>: Push the current page on the top of the backward stack. Pop the page from the top of the forward stack, making it the new current page. If the forward stack is empty, the command is ignored.</p> <p><strong>VISIT <url></strong>: Push the current page on the top of the backward stack, and make the URL specified the new current page. The forward stack is emptied.</p> <p><strong>QUIT</strong>: Quit the browser.</p> <p>Assume that the browser initially loads the web page at the URL http://www.acm.org/<br /><br /></p> <p><br /><strong>This problem contains multiple test cases!</strong></p> <p>The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.</p> <p>The output format consists of N output blocks. There is a blank line between output blocks.</p> <p><br /><strong>Input</strong></p> <p>Input is a sequence of commands. The command keywords BACK, FORWARD, VISIT, and QUIT are all in uppercase. URLs have no whitespace and have at most 70 characters. You may assume that no problem instance requires more than 100 elements in each stack at any time. The end of input is indicated by the QUIT command.<br /><br /></p> <p><strong>Output</strong></p> <p>For each command other than QUIT, print the URL of the current page after the command is executed if the command is not ignored. Otherwise, print "Ignored". The output for each command should be printed on its own line. No output is produced for the QUIT command.<br /><br /></p> <p><strong>Sample Input</strong></p> <p>1</p> <p>VISIT http://acm.ashland.edu/<br />VISIT http://acm.baylor.edu/acmicpc/<br />BACK<br />BACK<br />BACK<br />FORWARD<br />VISIT http://www.ibm.com/<br />BACK<br />BACK<br />FORWARD<br />FORWARD<br />FORWARD<br />QUIT<br /><br /></p> <p><strong>Sample Output</strong></p> <p>http://acm.ashland.edu/<br />http://acm.baylor.edu/acmicpc/<br />http://acm.ashland.edu/<br />http://www.acm.org/<br />Ignored<br />http://acm.ashland.edu/<br />http://www.ibm.com/<br />http://acm.ashland.edu/<br />http://www.acm.org/<br />http://acm.ashland.edu/<br />http://www.ibm.com/<br />Ignored<br /><br />AC浠g爜錛?/p> <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"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #000000">#include</span><span style="color: #000000"><</span><span style="color: #000000">stdio.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #0000ff">string</span><span style="color: #000000">.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #000000">malloc.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> StackSize 105</span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />typedef </span><span style="color: #0000ff">struct</span><span style="color: #000000"><br /><img id="Codehighlighter1_93_133_Open_Image" onclick="this.style.display='none'; Codehighlighter1_93_133_Open_Text.style.display='none'; Codehighlighter1_93_133_Closed_Image.style.display='inline'; Codehighlighter1_93_133_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_93_133_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_93_133_Closed_Text.style.display='none'; Codehighlighter1_93_133_Open_Image.style.display='inline'; Codehighlighter1_93_133_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_93_133_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_93_133_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">char</span><span style="color: #000000"> elemt[StackSize][</span><span style="color: #000000">73</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> top;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000">Stack;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> InitStack(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S)<br /><img id="Codehighlighter1_166_182_Open_Image" onclick="this.style.display='none'; Codehighlighter1_166_182_Open_Text.style.display='none'; Codehighlighter1_166_182_Closed_Image.style.display='inline'; Codehighlighter1_166_182_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_166_182_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_166_182_Closed_Text.style.display='none'; Codehighlighter1_166_182_Open_Image.style.display='inline'; Codehighlighter1_166_182_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_166_182_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_166_182_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      S</span><span style="color: #000000">-></span><span style="color: #000000">top</span><span style="color: #000000">=-</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> ElemtNum(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S)<br /><img id="Codehighlighter1_207_229_Open_Image" onclick="this.style.display='none'; Codehighlighter1_207_229_Open_Text.style.display='none'; Codehighlighter1_207_229_Closed_Image.style.display='inline'; Codehighlighter1_207_229_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_207_229_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_207_229_Closed_Text.style.display='none'; Codehighlighter1_207_229_Open_Image.style.display='inline'; Codehighlighter1_207_229_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_207_229_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_207_229_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> (S</span><span style="color: #000000">-></span><span style="color: #000000">top)</span><span style="color: #000000">+</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> IsFull(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S)<br /><img id="Codehighlighter1_252_288_Open_Image" onclick="this.style.display='none'; Codehighlighter1_252_288_Open_Text.style.display='none'; Codehighlighter1_252_288_Closed_Image.style.display='inline'; Codehighlighter1_252_288_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_252_288_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_252_288_Closed_Text.style.display='none'; Codehighlighter1_252_288_Open_Image.style.display='inline'; Codehighlighter1_252_288_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_252_288_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_252_288_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000">(S</span><span style="color: #000000">-></span><span style="color: #000000">top</span><span style="color: #000000">==</span><span style="color: #000000">StackSize</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">?</span><span style="color: #000000">1</span><span style="color: #000000">:</span><span style="color: #000000">0</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> PushStack(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S,</span><span style="color: #0000ff">char</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">x)<br /><img id="Codehighlighter1_322_462_Open_Image" onclick="this.style.display='none'; Codehighlighter1_322_462_Open_Text.style.display='none'; Codehighlighter1_322_462_Closed_Image.style.display='inline'; Codehighlighter1_322_462_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_322_462_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_322_462_Closed_Text.style.display='none'; Codehighlighter1_322_462_Open_Image.style.display='inline'; Codehighlighter1_322_462_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_322_462_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_322_462_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(IsFull(S))  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    S</span><span style="color: #000000">-></span><span style="color: #000000">top</span><span style="color: #000000">++</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    memset(S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top],</span><span style="color: #000000">'</span><span style="color: #000000">\0</span><span style="color: #000000">'</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top]));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    strcpy(S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top],x);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> PopStack(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S,</span><span style="color: #0000ff">char</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">x)<br /><img id="Codehighlighter1_495_664_Open_Image" onclick="this.style.display='none'; Codehighlighter1_495_664_Open_Text.style.display='none'; Codehighlighter1_495_664_Closed_Image.style.display='inline'; Codehighlighter1_495_664_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_495_664_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_495_664_Closed_Text.style.display='none'; Codehighlighter1_495_664_Open_Image.style.display='inline'; Codehighlighter1_495_664_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_495_664_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_495_664_Open_Text"><span style="color: #000000">{  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(ElemtNum(S)</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    memset(x,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(x));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      strcpy(x,S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top]);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    memset(S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top],</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top]));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    S</span><span style="color: #000000">-></span><span style="color: #000000">top</span><span style="color: #000000">--</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> GetTopElemt(Stack </span><span style="color: #000000">*</span><span style="color: #000000">S,</span><span style="color: #0000ff">char</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000">x)<br /><img id="Codehighlighter1_700_804_Open_Image" onclick="this.style.display='none'; Codehighlighter1_700_804_Open_Text.style.display='none'; Codehighlighter1_700_804_Closed_Image.style.display='inline'; Codehighlighter1_700_804_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_700_804_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_700_804_Closed_Text.style.display='none'; Codehighlighter1_700_804_Open_Image.style.display='inline'; Codehighlighter1_700_804_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_700_804_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_700_804_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000">(ElemtNum(S)</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      memset(x,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(x));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      strcpy(x,S</span><span style="color: #000000">-></span><span style="color: #000000">elemt[S</span><span style="color: #000000">-></span><span style="color: #000000">top]);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />      </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> main()<br /><img id="Codehighlighter1_817_1936_Open_Image" onclick="this.style.display='none'; Codehighlighter1_817_1936_Open_Text.style.display='none'; Codehighlighter1_817_1936_Closed_Image.style.display='inline'; Codehighlighter1_817_1936_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_817_1936_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_817_1936_Closed_Text.style.display='none'; Codehighlighter1_817_1936_Open_Image.style.display='inline'; Codehighlighter1_817_1936_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_817_1936_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_817_1936_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    Stack </span><span style="color: #000000">*</span><span style="color: #000000">sBack,</span><span style="color: #000000">*</span><span style="color: #000000">sForward;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    sBack</span><span style="color: #000000">=</span><span style="color: #000000">(Stack </span><span style="color: #000000">*</span><span style="color: #000000">)malloc(</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(Stack));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    sForward</span><span style="color: #000000">=</span><span style="color: #000000">(Stack </span><span style="color: #000000">*</span><span style="color: #000000">)malloc(</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(Stack));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> T;</span><span style="color: #0000ff">char</span><span style="color: #000000"> str[</span><span style="color: #000000">73</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">"</span><span style="color: #000000">,comd[</span><span style="color: #000000">8</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">"</span><span style="color: #000000">,tmp[</span><span style="color: #000000">73</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">"</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&</span><span style="color: #000000">T);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">while</span><span style="color: #000000">(T</span><span style="color: #000000">--</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1010_1894_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1010_1894_Open_Text.style.display='none'; Codehighlighter1_1010_1894_Closed_Image.style.display='inline'; Codehighlighter1_1010_1894_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1010_1894_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1010_1894_Closed_Text.style.display='none'; Codehighlighter1_1010_1894_Open_Image.style.display='inline'; Codehighlighter1_1010_1894_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_1010_1894_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1010_1894_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        InitStack(sBack); InitStack(sForward);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        PushStack(sBack,</span><span style="color: #000000">"</span><span style="color: #000000">http://www.acm.org/</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">while</span><span style="color: #000000">(</span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1108_1866_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1108_1866_Open_Text.style.display='none'; Codehighlighter1_1108_1866_Closed_Image.style.display='inline'; Codehighlighter1_1108_1866_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1108_1866_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1108_1866_Closed_Text.style.display='none'; Codehighlighter1_1108_1866_Open_Image.style.display='inline'; Codehighlighter1_1108_1866_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_1108_1866_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1108_1866_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            memset(comd,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(comd));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%s</span><span style="color: #000000">"</span><span style="color: #000000">,comd);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">if</span><span style="color: #000000">(strcmp(comd,</span><span style="color: #000000">"</span><span style="color: #000000">BACK</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 /><img id="Codehighlighter1_1196_1396_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1196_1396_Open_Text.style.display='none'; Codehighlighter1_1196_1396_Closed_Image.style.display='inline'; Codehighlighter1_1196_1396_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1196_1396_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1196_1396_Closed_Text.style.display='none'; Codehighlighter1_1196_1396_Open_Image.style.display='inline'; Codehighlighter1_1196_1396_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_1196_1396_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1196_1396_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(ElemtNum(sBack)</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1229_1277_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1229_1277_Open_Text.style.display='none'; Codehighlighter1_1229_1277_Closed_Image.style.display='inline'; Codehighlighter1_1229_1277_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1229_1277_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1229_1277_Closed_Text.style.display='none'; Codehighlighter1_1229_1277_Open_Image.style.display='inline'; Codehighlighter1_1229_1277_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_1229_1277_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1229_1277_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    printf(</span><span style="color: #000000">"</span><span style="color: #000000">Ignored\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    </span><span style="color: #0000ff">continue</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />                }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                PopStack(sBack,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                PushStack(sForward,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(GetTopElemt(sBack,tmp)</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    printf(</span><span style="color: #000000">"</span><span style="color: #000000">%s\n</span><span style="color: #000000">"</span><span style="color: #000000">,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(strcmp(comd,</span><span style="color: #000000">"</span><span style="color: #000000">FORWARD</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 /><img id="Codehighlighter1_1439_1642_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1439_1642_Open_Text.style.display='none'; Codehighlighter1_1439_1642_Closed_Image.style.display='inline'; Codehighlighter1_1439_1642_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1439_1642_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1439_1642_Closed_Text.style.display='none'; Codehighlighter1_1439_1642_Open_Image.style.display='inline'; Codehighlighter1_1439_1642_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_1439_1642_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1439_1642_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(ElemtNum(sForward)</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)<br /><img id="Codehighlighter1_1475_1523_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1475_1523_Open_Text.style.display='none'; Codehighlighter1_1475_1523_Closed_Image.style.display='inline'; Codehighlighter1_1475_1523_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1475_1523_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1475_1523_Closed_Text.style.display='none'; Codehighlighter1_1475_1523_Open_Image.style.display='inline'; Codehighlighter1_1475_1523_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_1475_1523_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1475_1523_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    printf(</span><span style="color: #000000">"</span><span style="color: #000000">Ignored\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    </span><span style="color: #0000ff">continue</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />                }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                PopStack(sForward,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                PushStack(sBack,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(GetTopElemt(sBack,tmp)</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">)<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                    printf(</span><span style="color: #000000">"</span><span style="color: #000000">%s\n</span><span style="color: #000000">"</span><span style="color: #000000">,tmp);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(strcmp(comd,</span><span style="color: #000000">"</span><span style="color: #000000">VISIT</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 /><img id="Codehighlighter1_1683_1816_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1683_1816_Open_Text.style.display='none'; Codehighlighter1_1683_1816_Closed_Image.style.display='inline'; Codehighlighter1_1683_1816_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_1683_1816_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1683_1816_Closed_Text.style.display='none'; Codehighlighter1_1683_1816_Open_Image.style.display='inline'; Codehighlighter1_1683_1816_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_1683_1816_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1683_1816_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                memset(str,</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #0000ff">sizeof</span><span style="color: #000000">(str));<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%s</span><span style="color: #000000">"</span><span style="color: #000000">,str);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                printf(</span><span style="color: #000000">"</span><span style="color: #000000">%s\n</span><span style="color: #000000">"</span><span style="color: #000000">,str);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                PushStack(sBack,str);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                InitStack(sForward);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(strcmp(comd,</span><span style="color: #000000">"</span><span style="color: #000000">QUIT</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 /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">break</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(T</span><span style="color: #000000">></span><span style="color: #000000">0</span><span style="color: #000000">) printf(</span><span style="color: #000000">"</span><span style="color: #000000">\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    free(sBack);free(sForward);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span></div> <p><br /></p><img src ="http://www.shnenglu.com/codepeng/aggbug/155165.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/codepeng/" target="_blank">acpeng</a> 2011-09-05 22:47 <a href="http://www.shnenglu.com/codepeng/archive/2011/09/05/155165.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>HDU 1862 EXCEL鎺掑簭http://www.shnenglu.com/codepeng/archive/2011/09/05/155160.htmlacpengacpengMon, 05 Sep 2011 14:20:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/09/05/155160.htmlhttp://www.shnenglu.com/codepeng/comments/155160.htmlhttp://www.shnenglu.com/codepeng/archive/2011/09/05/155160.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/155160.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/155160.htmlhttp://acm.hdu.edu.cn/showproblem.php?pid=1862
緇撴瀯浣撴帓搴忥紝C++鐨刟lgorithm錛屽啓涓変釜cmp鍗沖彲
涓嶈繃浠ヨ繖涓暟鎹殑璇濓紝浣曞繀TimeLimit=5000ms~~
#include<cstdio>
#include
<cstring>
#include
<algorithm>
using namespace std;
typedef 
struct infor
{
    
char stu_num[7];
    
char name[9];
    
int scor;
}
stu;
stu data[
100002];
int cmp1(stu a,stu b)
{
    
if(strcmp(a.stu_num,b.stu_num)<0)return 1;
    
return 0;
}

int cmp2(stu a,stu b)
{
    
if(strcmp(a.name,b.name)<0)return 1;
    
else if(strcmp(a.name,b.name)==0)
    
{
        
if(strcmp(a.stu_num,b.stu_num)<0)return 1;
    }

    
return 0;
}

int cmp3(stu a,stu b)
{
    
if(a.scor<b.scor)return 1;
    
else if(a.scor==b.scor)
    
{
        
if(strcmp(a.stu_num,b.stu_num)<0)return 1;
    }

    
return 0;
}

int main()
{
    
int n,c,i,test=1;
    
while(scanf("%d%d",&n,&c),n)
    
{
        
for(i=0;i<n;i++)
            scanf(
"%s%s%d",data[i].stu_num,data[i].name,&data[i].scor);
        
if(c==1)sort(data,data+n,cmp1);
        
else if(c==2)sort(data,data+n,cmp2);
        
else sort(data,data+n,cmp3);
        printf(
"Case %d:\n",test++);
        
for(i=0;i<n;i++)
            printf(
"%s %s %d\n",data[i].stu_num,data[i].name,data[i].scor);
    }

    
return 0;
}



acpeng 2011-09-05 22:20 鍙戣〃璇勮
]]>
POJ 2273 An Excel-lent Problemhttp://www.shnenglu.com/codepeng/archive/2011/09/05/155158.htmlacpengacpengMon, 05 Sep 2011 13:53:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/09/05/155158.htmlhttp://www.shnenglu.com/codepeng/comments/155158.htmlhttp://www.shnenglu.com/codepeng/archive/2011/09/05/155158.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/155158.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/155158.html

鎶婃暣鏁拌漿鍖栦負excel瀵瑰簲鐨勫垪鍊?a >http://poj.org/problem?id=2273
Description

A certain spreadsheet program labels the columns of a spreadsheet using letters. Column 1 is labeled as ``A", column 2 as ``B", ..., column 26 as ``Z". When the number of columns is greater than 26, another letter is used. For example, column 27 is ``AA", column 28 is ``AB" and column 52 is ``AZ". It follows that column 53 would be ``BA" and so on. Similarly, when column ``ZZ" is reached, the next column would be ``AAA", then ``AAB" and so on.

The rows in the spreadsheet are labeled using the row number. Rows start at 1.

The designation for a particular cell within the spreadsheet is created by combining the column label with the row label. For example, the upper-left most cell would be ``A1". The cell at column 55 row 23 would be ``BC23".

You will write a program that converts numeric row and column values into the spreadsheet designation.

Input

Input consists of lines of the form: RnCm. n represents the row number [1,300000000] and m represents the column number, 1<=m<=300000000. The values n and m define a single cell on the spreadsheet. Input terminates with the line: R0C0 (that is, n and m are 0). There will be no leading zeroes or extra spaces in the input.

Output

For each line of input (except the terminating line), you will print out the spreadsheet designation for the specified cell as described above.

Sample Input

R1C1
R3C1
R1C3
R299999999C26
R52C52
R53C17576
R53C17602
R0C0

Sample Output

A1
A3
C1
Z299999999
AZ52
YYZ53
YZZ53

Source

Greater New York 2004

榪涘埗杞寲闂錛屾妸鍒楁暟鏀規垚26榪涘埗杈撳嚭錛屽垎鍒敤A,B...Z浠f浛1,2,3...榪欓噷base[0]='Z'錛岃〃紺簄涓?6浣欐暟涓?鏃剁殑鍙栧鹼紝浣嗚繘浣嶉棶棰橀渶瑕佹敞鎰忥紝鍒嗕綑鏁版槸鍚︿負0涓ょ鎯呭喌鍒嗘瀽銆?br />浠g爜錛?
#include<stdio.h>
#define R 26
char base[30]="ZABCDEFGHIJKLMNOPQRSTUVWXYZ";
void fun(int N)
{
    
int i=0,j; char str[10];
    
while(N>R)
    
{
        str[i
++]=base[N%R];
        N
=N%R==0?N/R-1:N/R;
    }

    str[i]
=base[N];
    
for(j=i;j>=0;j--)
        printf(
"%c",str[j]);
}

int main()
{
    
int m,n;
    
while(scanf("%*c%d%*c%d",&m,&n)!=EOF)
    
{
        getchar();
        
if(m==0 && n==0)break;
        fun(n);
        printf(
"%d\n",m);
    }

    
return 0;
}



acpeng 2011-09-05 21:53 鍙戣〃璇勮
]]>
HDU 1166鏁屽叺甯冮樀http://www.shnenglu.com/codepeng/archive/2011/09/01/154891.htmlacpengacpengThu, 01 Sep 2011 09:14:00 GMThttp://www.shnenglu.com/codepeng/archive/2011/09/01/154891.htmlhttp://www.shnenglu.com/codepeng/comments/154891.htmlhttp://www.shnenglu.com/codepeng/archive/2011/09/01/154891.html#Feedback0http://www.shnenglu.com/codepeng/comments/commentRss/154891.htmlhttp://www.shnenglu.com/codepeng/services/trackbacks/154891.html棰樼洰閾炬帴錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1166
鍒濆綰挎鏍戯紝鏈兂浜涗釜鏍戯紝鍐欎簡涓鍗婂疄鍦ㄦ槸瑙夊緱娌″繀瑕侊紝姝ら鐩存帴鐢ㄦ暟緇勬ā鎷燂紝鏋滄柇AC錛?Y~~~
#include<stdio.h>
#include
<string.h>
int data[50003];
int main()
{
    
int T,N,i,cont=1;
    
int cd_1,cd_2,sum;
    
char comd[7]="\0";
    scanf(
"%d",&T);
    
while(T--)
    
{
        scanf(
"%d",&N);
        printf(
"Case %d:\n",cont);
        cont
++;
        
for(i=0;i<N;i++)
            scanf(
"%d",&data[i]);
        scanf(
"%s",comd);
        
while(strcmp(comd,"End")!=0)
        
{
            scanf(
"%d%d",&cd_1,&cd_2);
            
if(comd[0]=='A')
                data[cd_1
-1]+=cd_2;
            
else if(comd[0]=='S')
                data[cd_1
-1]-=cd_2;
            
else if(comd[0]=='Q')
            
{
                sum
=0;
                
for(i=cd_1-1;i<cd_2;i++)
                    sum
+=data[i];
                printf(
"%d\n",sum);
            }

            memset(comd,
0,sizeof(comd));
            scanf(
"%s",comd);
        }

    }

    
return 0;
}



acpeng 2011-09-01 17:14 鍙戣〃璇勮
]]>
HDU 1022 Train Problem I_鏁版嵁緇撴瀯_鏍?/title><link>http://www.shnenglu.com/codepeng/archive/2011/08/26/154443.html</link><dc:creator>acpeng</dc:creator><author>acpeng</author><pubDate>Fri, 26 Aug 2011 10:04:00 GMT</pubDate><guid>http://www.shnenglu.com/codepeng/archive/2011/08/26/154443.html</guid><wfw:comment>http://www.shnenglu.com/codepeng/comments/154443.html</wfw:comment><comments>http://www.shnenglu.com/codepeng/archive/2011/08/26/154443.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/codepeng/comments/commentRss/154443.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/codepeng/services/trackbacks/154443.html</trackback:ping><description><![CDATA[<div>棰樼洰鍦板潃錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1022</a><br /> <div id="icwqiyo" class="panel_title" align="left"><strong style="color: #0000ff">Problem Description</strong></div> <div id="ygimwmc" class="panel_content">     As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is only one railway where all the trains stop. So all the trains come in from one side and get out from the other side. For this problem, if train A gets into the railway first, and then train B gets into the railway before train A leaves, train A can't leave until train B leaves. The pictures below figure out the problem. Now the problem for you is, there are at most 9 trains in the station, all the trains has an ID(numbered from 1 to n), the trains get into the railway in an order O1, your task is to determine whether the trains can get out in an order O2.<br /><img src="http://acm.hdu.edu.cn/data/images/1022-1.jpg" alt="" /><img src="http://acm.hdu.edu.cn/data/images/1022-2.jpg" alt="" /><img src="http://acm.hdu.edu.cn/data/images/1022-3.jpg" alt="" /><br /></div> <div id="aykmoei" class="panel_title" align="left"><strong style="color: #0000ff">Input</strong></div> <div id="ggqcwca" class="panel_content">The input contains several test cases. Each test case consists of an integer, the number of trains, and two strings, the order of the trains come in:O1, and the order of the trains leave:O2. The input is terminated by the end of file. More details in the Sample Input.</div> <div id="mmwgigw" class="panel_title" align="left"><span style="color: #0000ff"><strong>Output</strong></span></div> <div id="mueoywe" class="panel_content">The output contains a string "No." if you can't exchange O2 to O1, or you should output a line contains "Yes.", and then output your way in exchanging the order(you should output "in" for a train getting into the railway, and "out" for a train getting out of the railway). Print a line contains "FINISH" after each test case. More details in the Sample Output.<br /></div> <div id="ecwysyo" class="panel_title" align="left"><span style="color: #0000ff"><strong>Sample Input</strong></span></div> <div id="oeeikqy" class="panel_content"><pre><div style="font-family: Courier New,Courier,monospace">3 123 321 3 123 312<br /></div></pre></div> <div id="syakmkk" class="panel_title" align="left"><span style="color: #0000ff"><strong>Sample Output</strong></span></div> <div id="gwaamcs" class="panel_content"><pre><div style="font-family: Courier New,Courier,monospace">Yes. in in in out out out FINISH No. FINISH 涓嬮潰鏄唬鐮侊紝絎竴嬈′嬌鐢–++鐨凷TL妯℃澘錛岀敤鐨勫緢涓嶇啛緇冿紝涓嶈繃娌℃兂鍒?Y灝辮繃浜唦~~YY銆傘傘?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"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #000000">#include</span><span style="color: #000000"><</span><span style="color: #000000">cstdio</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />#include</span><span style="color: #000000"><</span><span style="color: #000000">stack</span><span style="color: #000000">></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> </span><span style="color: #0000ff">namespace</span><span style="color: #000000"> std;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000"> main()<br /><img id="Codehighlighter1_65_965_Open_Image" onclick="this.style.display='none'; Codehighlighter1_65_965_Open_Text.style.display='none'; Codehighlighter1_65_965_Closed_Image.style.display='inline'; Codehighlighter1_65_965_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_65_965_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_65_965_Closed_Text.style.display='none'; Codehighlighter1_65_965_Open_Image.style.display='inline'; Codehighlighter1_65_965_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_65_965_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_65_965_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> i,j,k,n,ok,flg[</span><span style="color: #000000">22</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">char</span><span style="color: #000000"> </span><span style="color: #0000ff">in</span><span style="color: #000000">[</span><span style="color: #000000">10</span><span style="color: #000000">],</span><span style="color: #0000ff">out</span><span style="color: #000000">[</span><span style="color: #000000">10</span><span style="color: #000000">];<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">while</span><span style="color: #000000">(scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&</span><span style="color: #000000">n)</span><span style="color: #000000">!=</span><span style="color: #000000">EOF)<br /><img id="Codehighlighter1_155_949_Open_Image" onclick="this.style.display='none'; Codehighlighter1_155_949_Open_Text.style.display='none'; Codehighlighter1_155_949_Closed_Image.style.display='inline'; Codehighlighter1_155_949_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_155_949_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_155_949_Closed_Text.style.display='none'; Codehighlighter1_155_949_Open_Image.style.display='inline'; Codehighlighter1_155_949_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_155_949_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_155_949_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%s%s</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #0000ff">in</span><span style="color: #000000">,</span><span style="color: #0000ff">out</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        stack</span><span style="color: #000000"><</span><span style="color: #0000ff">int</span><span style="color: #000000">></span><span style="color: #000000"> s;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        i</span><span style="color: #000000">=</span><span style="color: #000000">j</span><span style="color: #000000">=</span><span style="color: #000000">k</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;ok</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">while</span><span style="color: #000000">(j</span><span style="color: #000000"><</span><span style="color: #000000">n)<br /><img id="Codehighlighter1_258_673_Open_Image" onclick="this.style.display='none'; Codehighlighter1_258_673_Open_Text.style.display='none'; Codehighlighter1_258_673_Closed_Image.style.display='inline'; Codehighlighter1_258_673_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_258_673_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_258_673_Closed_Text.style.display='none'; Codehighlighter1_258_673_Open_Image.style.display='inline'; Codehighlighter1_258_673_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_258_673_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_258_673_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #0000ff">in</span><span style="color: #000000">[i]</span><span style="color: #000000">==</span><span style="color: #0000ff">out</span><span style="color: #000000">[j])<br /><img id="Codehighlighter1_302_363_Open_Image" onclick="this.style.display='none'; Codehighlighter1_302_363_Open_Text.style.display='none'; Codehighlighter1_302_363_Closed_Image.style.display='inline'; Codehighlighter1_302_363_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_302_363_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_302_363_Closed_Text.style.display='none'; Codehighlighter1_302_363_Open_Image.style.display='inline'; Codehighlighter1_302_363_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_302_363_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_302_363_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                flg[k</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">;flg[k</span><span style="color: #000000">++</span><span style="color: #000000">]</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;i</span><span style="color: #000000">++</span><span style="color: #000000">;j</span><span style="color: #000000">++</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #000000">!</span><span style="color: #000000">s.empty() </span><span style="color: #000000">&&</span><span style="color: #000000"> s.top()</span><span style="color: #000000">==</span><span style="color: #000000">(</span><span style="color: #0000ff">out</span><span style="color: #000000">[j]</span><span style="color: #000000">-</span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">))<br /><img id="Codehighlighter1_434_488_Open_Image" onclick="this.style.display='none'; Codehighlighter1_434_488_Open_Text.style.display='none'; Codehighlighter1_434_488_Closed_Image.style.display='inline'; Codehighlighter1_434_488_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_434_488_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_434_488_Closed_Text.style.display='none'; Codehighlighter1_434_488_Open_Image.style.display='inline'; Codehighlighter1_434_488_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_434_488_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_434_488_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                flg[k</span><span style="color: #000000">++</span><span style="color: #000000">]</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;s.pop();j</span><span style="color: #000000">++</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">(i</span><span style="color: #000000"><</span><span style="color: #000000">n)<br /><img id="Codehighlighter1_527_589_Open_Image" onclick="this.style.display='none'; Codehighlighter1_527_589_Open_Text.style.display='none'; Codehighlighter1_527_589_Closed_Image.style.display='inline'; Codehighlighter1_527_589_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_527_589_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_527_589_Closed_Text.style.display='none'; Codehighlighter1_527_589_Open_Image.style.display='inline'; Codehighlighter1_527_589_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_527_589_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_527_589_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                s.push(</span><span style="color: #0000ff">in</span><span style="color: #000000">[i</span><span style="color: #000000">++</span><span style="color: #000000">]</span><span style="color: #000000">-</span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">);flg[k</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 /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"> <br /><img id="Codehighlighter1_621_663_Open_Image" onclick="this.style.display='none'; Codehighlighter1_621_663_Open_Text.style.display='none'; Codehighlighter1_621_663_Closed_Image.style.display='inline'; Codehighlighter1_621_663_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_621_663_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_621_663_Closed_Text.style.display='none'; Codehighlighter1_621_663_Open_Image.style.display='inline'; Codehighlighter1_621_663_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_621_663_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_621_663_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                ok</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;</span><span style="color: #0000ff">break</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(ok</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)printf(</span><span style="color: #000000">"</span><span style="color: #000000">No.\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        </span><span style="color: #0000ff">else</span><span style="color: #000000"><br /><img id="Codehighlighter1_731_914_Open_Image" onclick="this.style.display='none'; Codehighlighter1_731_914_Open_Text.style.display='none'; Codehighlighter1_731_914_Closed_Image.style.display='inline'; Codehighlighter1_731_914_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_731_914_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_731_914_Closed_Text.style.display='none'; Codehighlighter1_731_914_Open_Image.style.display='inline'; Codehighlighter1_731_914_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_731_914_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_731_914_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            printf(</span><span style="color: #000000">"</span><span style="color: #000000">Yes.\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />            </span><span style="color: #0000ff">for</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">k;i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /><img id="Codehighlighter1_805_904_Open_Image" onclick="this.style.display='none'; Codehighlighter1_805_904_Open_Text.style.display='none'; Codehighlighter1_805_904_Closed_Image.style.display='inline'; Codehighlighter1_805_904_Closed_Text.style.display='inline';" align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_805_904_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_805_904_Closed_Text.style.display='none'; Codehighlighter1_805_904_Open_Image.style.display='inline'; Codehighlighter1_805_904_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_805_904_Closed_Text"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_805_904_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(flg[i]</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)printf(</span><span style="color: #000000">"</span><span style="color: #000000">in\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />                </span><span style="color: #0000ff">else</span><span style="color: #000000"> printf(</span><span style="color: #000000">"</span><span style="color: #000000">out\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />            }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />        }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />        printf(</span><span style="color: #000000">"</span><span style="color: #000000">FINISH\n</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" />    }</span></span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" />}</span></span></div><br /><br /></div></pre></div></div><img src ="http://www.shnenglu.com/codepeng/aggbug/154443.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/codepeng/" target="_blank">acpeng</a> 2011-08-26 18:04 <a href="http://www.shnenglu.com/codepeng/archive/2011/08/26/154443.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.xiatiancaiwu.cn" target="_blank">久久久久国产一区二区</a>| <a href="http://www.d2338.cn" target="_blank">国产精品丝袜久久久久久不卡</a>| <a href="http://www.sai-shang.cn" target="_blank">久久精品国产99国产精品亚洲 </a>| <a href="http://www.vdmo.cn" target="_blank">久久久久亚洲AV成人网人人软件</a>| <a href="http://www.ybyibao.cn" target="_blank">色婷婷久久综合中文久久一本</a>| <a href="http://www.liuxuehanguo.cn" target="_blank">欧美日韩精品久久久免费观看</a>| <a href="http://www.qhsn.net.cn" target="_blank">久久精品www人人爽人人</a>| <a href="http://www.566wan.cn" target="_blank">青青青青久久精品国产h久久精品五福影院1421 </a>| <a href="http://www.uusee5.org.cn" target="_blank">精品久久香蕉国产线看观看亚洲</a>| <a href="http://www.tvauto.cn" target="_blank">久久久久97国产精华液好用吗</a>| <a href="http://www.chechuai.cn" target="_blank">日韩AV无码久久一区二区</a>| <a href="http://www.nbblack.cn" target="_blank">久久久久国产精品麻豆AR影院 </a>| <a href="http://www.ems1.cn" target="_blank">精品久久人人做人人爽综合 </a>| <a href="http://www.86bzpp.cn" target="_blank">美女写真久久影院</a>| <a href="http://www.zzouyi.cn" target="_blank">亚洲AV日韩AV永久无码久久</a>| <a href="http://www.tongshenghu.com.cn" target="_blank">丁香久久婷婷国产午夜视频</a>| <a href="http://www.tprs.com.cn" target="_blank">久久综合久久自在自线精品自</a>| <a href="http://www.366509.cn" target="_blank">婷婷久久综合九色综合绿巨人</a>| <a href="http://www.laobianjing.cn" target="_blank">久久精品国产一区</a>| <a href="http://www.gbagba.cn" target="_blank">久久精品国产亚洲精品2020</a>| <a href="http://www.wthangjia.cn" target="_blank">久久久久久亚洲精品影院</a>| <a href="http://www.bandetek.cn" target="_blank">久久久WWW免费人成精品</a>| <a href="http://www.cuinfo.cn" target="_blank">国产福利电影一区二区三区久久久久成人精品综合 </a>| <a href="http://www.huiseng.cn" target="_blank">91久久精品视频</a>| <a href="http://www.jrbjh.cn" target="_blank">国产欧美一区二区久久</a>| <a href="http://www.ktze6z.cn" target="_blank">日产精品久久久久久久</a>| <a href="http://www.tfy8.cn" target="_blank">中文字幕热久久久久久久</a>| <a href="http://www.dyhao.com.cn" target="_blank">久久综合偷偷噜噜噜色</a>| <a href="http://www.xici.cq.cn" target="_blank">综合久久一区二区三区</a>| <a href="http://www.shipin168.cn" target="_blank">日韩欧美亚洲国产精品字幕久久久</a>| <a href="http://www.haokan1.cn" target="_blank">亚洲国产成人久久精品影视</a>| <a href="http://www.vjyg.cn" target="_blank">久久综合综合久久狠狠狠97色88</a>| <a href="http://www.jituansms.cn" target="_blank">国产精品对白刺激久久久</a>| <a href="http://www.frwg.net.cn" target="_blank">久久精品国产99久久久 </a>| <a href="http://www.sosolishi.cn" target="_blank">久久国产成人亚洲精品影院</a>| <a href="http://www.mirbase.cn" target="_blank">久久97精品久久久久久久不卡</a>| <a href="http://www.cnhtyy.cn" target="_blank">99re久久精品国产首页2020</a>| <a href="http://www.liess.cn" target="_blank">精品久久8x国产免费观看</a>| <a href="http://www.jiawengc.cn" target="_blank">国产精品无码久久综合</a>| <a href="http://www.tehmd.cn" target="_blank">久久最近最新中文字幕大全</a>| <a href="http://www.satyw.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>