锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久婷婷五月亚洲97号色,一级A毛片免费观看久久精品,久久久国产亚洲精品http://www.shnenglu.com/sunkehappy/zh-cnSat, 10 May 2025 01:03:14 GMTSat, 10 May 2025 01:03:14 GMT60zoj1405_Tanning Salonhttp://www.shnenglu.com/sunkehappy/archive/2009/08/07/92510.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Fri, 07 Aug 2009 03:50:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/08/07/92510.htmlhttp://www.shnenglu.com/sunkehappy/comments/92510.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/08/07/92510.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/92510.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/92510.html        鍦?1 ABAB  榪欑粍鏁版嵁涓婇敊浜嗭紝鏀硅繃鏉ヤ箣鍚庡氨榪囦簡錛屼笅涓嬈′竴瀹氳濂藉ソ璇婚銆?br>        榪欎竴嬈℃槸灝介噺鐢–++鏉ュ啓錛屽湪鐢╮find鍑芥暟鐨勬椂鍊欏嚭浜嗕竴鐐瑰皬闂錛屽簲璇ユ槸浠庤繖涓瓧絎﹀線鍓嶆帹涓浣嶅紑濮嬫煡鎵撅紝鑻ユ槸絎竴涓瓧絎︼紝灝變笉鑳借皟鐢ㄥ嚱鏁頒簡錛屼笉鐒跺氨浼氬嚭閿欍傛墍浠ュ氨澶氬姞浜嗕竴涓垽鏂紝褰卞搷浜嗙▼搴忕殑鍙鎬с備笅涓嬈¤鎵懼埌涓涓笉闇瑕佽繖鏍峰垽鏂殑鏂規硶銆?br>
#include<iostream>
#include
<string>
#define DEBUG 1
using namespace std ;

const int cap = 33 ;

char salon[cap] ;
string in ;

int check( int avai )
{
    
int i, j, pos(-1), flag, away(0) ;
    
for( i=0; i<in.size(); ++i ){
        
if( i >= 1 )
            pos 
= in.rfind( in[i], i ) ;
        
if( pos >= 0 ){
            flag 
= 0 ;
            
for( j=0; j<avai; ++j ){
                
if( salon[j] == in[i] ){
                    salon[j] 
= '\0' ;
                    flag 
= 1 ;
                    
break ;
                }

            }

            
if!flag )    {
                
for( j=0; j<avai; ++j ){
                    
if!salon[j] ){
                        flag 
= 1 ;
                        
break ;
                    }

                }

            }

            
if!flag )
                
++away ;
        }

        
else{
            
for( j=0; j<avai; ++j ){
                
if!salon[j] ){
                    salon[j] 
= in[i] ;
                    
break ;
                }

            }

        }

    }

    
return away ;
}


void output( int away )
{
    
if( away )
        cout 
<< away << " customer(s) walked away." << endl ;
    
else
        cout 
<< "All customers tanned successfully." << endl ;
}


int main( )
{
    
#if DEBUG
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\in.in","r",stdin) ;
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\out.out","w",stdout) ;
    
#endif

    
int avai, away ;
    
while( cin >> avai ){
        
if( avai == 0 )
            
break ;
        cin 
>> in ;
        away 
= check( avai ) ;
        output( away ) ;
    }
    
    
return 0 ;
}



]]>
zoj1002 Fire Nethttp://www.shnenglu.com/sunkehappy/archive/2009/07/26/91255.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Sun, 26 Jul 2009 09:33:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/07/26/91255.htmlhttp://www.shnenglu.com/sunkehappy/comments/91255.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/07/26/91255.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/91255.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/91255.html        濂戒箙閮芥病鏈夊啓瑙i鎬葷粨浜嗭紝鎵嬬敓浜嗐傛姄绱ф椂闂村仛棰橈紝涓嶇劧絳夊埌寮瀛︿簡錛屽氨涓嶈兘榪欎箞鐖界殑鍋氶浜嗐?/font>

        榪欎釜棰樻暟鎹噺涓嶅ぇ錛屽彲浠ョ敤鍥炴函銆傚垰寮濮嬪仛鐨勬椂鍊欙紝鏄敤騫挎悳錛屼絾鏄啓璧鋒潵瓚呴夯鐑︼紝浠g爜閲忔瀬澶э紝寰堝鏄撳嚭閿欍傚弬鑰冧簡澶х墰浠殑鍋氭硶錛屾墠鎯寵搗鏉ュ拰N鐨囧悗闂寰堝儚銆傛垜浠彲浠ヤ粠涓涓偣鍑哄彂錛岀劧鍚庡線鍙充笅鎵╂暎錛屾墿鏁e畬浜嗕箣鍚庯紝鍐嶅洖婧紝鍐嶆墿鏁?#8230;… 闂瑙e喅銆?/font>

#include<iostream>
#define DEBUG 0
using namespace std ;

int n, maxi ;
char a[5][5] ;

bool legal( int x, int y )
{
    
int i, j ;
    
for( i=x-1; i>=0--i ){
        
if( a[i][y] == '@' )
            
return false ;
        
else if( a[i][y] == 'X' )
            
break ;
    }

    
for( j=y-1; j>=0--j ){
        
if( a[x][j] == '@' )
            
return false ;
        
else if( a[x][j] == 'X' )
            
break ;
    }

    
return true ;
}


void trace( int x, int y, int geshu )
{
    
if( x == n )
        maxi 
= maxi>geshu ? maxi:geshu ;
    
else{
        
if( y == n )
            trace( x
+10, geshu ) ;
        
else {
            
if( a[x][y]=='.' && legal( x, y ) ){
                
// 鍥炴函鏍囪 
                a[x][y] = '@' ;
                trace( x, y
+1, geshu+1 ) ;
                a[x][y] 
= '.' ;
            }

            trace( x, y
+1, geshu ) ;
        }

    }

}


int main()
{
    
#if DEBUG
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\in.in","r",stdin) ;
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\out.out","w",stdout) ;
    
#endif

    
int i, j ;
    
while( cin >> n ){
        
if!n )
            
break ;
        
for( i=0; i<n; ++i ){
            
for( j=0; j<n; ++j ){
                cin 
>> a[i][j] ;
            }

        }

        maxi 
= 0 ;
        
// 浠?錛?寮濮嬪洖婧?nbsp;
        trace( 000 ) ;
        cout 
<< maxi << endl ;
    }

    
    
return 0 ;
}



]]>
hdu1016_Prime Ring Problemhttp://www.shnenglu.com/sunkehappy/archive/2009/06/05/86825.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Fri, 05 Jun 2009 02:55:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/06/05/86825.htmlhttp://www.shnenglu.com/sunkehappy/comments/86825.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/06/05/86825.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/86825.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/86825.html        綆鍗曡屼笖緇忓吀鐨勬悳绱㈤錛岀敤鍥炴函鍋氥傚浜庝粈涔堟槸鍥炴函浠涔堟槸DFS鎴戝垎涓嶆竻銆傚氨鏄寜浣嶉愪釜鍒ゆ柇錛岀洿鍒版壘鍒扮粨鏋滐紝鎴栬呭嚭鐣岄鍑恒?br>

#include<iostream>
#include
<cmath>
using namespace std ;
int n, a[111], k, ans[22], anscnt ;
int p[42]= {0,0,2,3,0,5,0,7,0,0,0,11,0,13,0,0,0,17,0,19,0,
           
0,0,23,0,0,0,0,0,29,0,31,0,0,0,0,0,37,0,0,0,41}
 ;

int rev[100][20], revcnt ;

void DFS( int m, int geshu )
{
    
int i, j ;
    
if( geshu == n && p[1+m] ){
        cout 
<< ans[0] ;
        
for( i=1; i<n; ++i ){
            cout 
<< " " << ans[i] ;
            rev[revcnt][i] 
= ans[i] ;
        }

        
++revcnt ;
        cout 
<< "\n" ;
    }

    
else if( geshu == n )
        
return ;
    
for( j=2; j<=n; ++j ){
        
if( j<p[j+m] && !a[j] ){
            a[j] 
= 1 ;
            ans[geshu] 
= j ;
            DFS( j, geshu
+1 ) ;
            a[j] 
= 0 ;
        }

    }

}


int main( )
{
    
int i, j ;
    
for( j=1; cin >> n; ++j ){
        cout 
<< "Case "<< j << ":\n" ;
        
for( i=0; i<111++i )
            a[i] 
= 0 ;
        revcnt 
= 0 ;
        k 
= 1 ;
        ans[
0= 1 ;
        anscnt 
= 1 ;
        DFS( 
11 ) ;
        cout 
<< "\n";
    }

    
return 0 ;
}



]]>
hdu2303_The Embarrassed Cryptographerhttp://www.shnenglu.com/sunkehappy/archive/2009/05/30/86175.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Sat, 30 May 2009 07:38:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/05/30/86175.htmlhttp://www.shnenglu.com/sunkehappy/comments/86175.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/05/30/86175.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/86175.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/86175.html        濂藉嚑澶╅兘娌℃湁鍒烽浜嗭紝蹇冮噷濂界儲韜佸晩錛?/font>

        浠婂ぉ緇堜簬鍙堝仛浜嗕竴涓笉鏄緢姘寸殑棰樼洰錛屾暟璁虹殑錛屽ぇ鏁存暟鍙栦綑錛岀洿鎺ユ毚鍔涜繃浜嗐傚叾涓張瀛︿簡涓縐嶇礌鏁扮殑絳涢夋硶錛屾晥鐜囨瘮鎴戜互鍓嶇敤鐨勬柟娉曢兘瑕侀珮銆備粬涓嶈綆楋紝鍙槸絳涢夈傝繖鏍蜂竴鏉ユ晥鐜囧氨楂樹簡寰堝銆傝繕鏈変竴涓湴鏂癸紝灝辨槸澶ф暣鏁扮殑鍙栦綑錛屼粠楂樹綅錛屽埌浣庝綅錛岃竟涔樿竟鍙栦綑錛屾牴鎹殑鏄悓浣欏畾鐞嗐?/font>


#include <stdio.h>
#include 
<string.h>
#include 
<stdlib.h>

int p[1000000] ;
char pr[1000000] ;
int len, pnum, num[14] ;

void prime( )
{
    
int i, j ;
    
// 絳涢夌礌鏁?nbsp;
    for( i=2; i<1000000++i ){
        pr[i] 
= 1 ;
    }

    
for( i=2,pnum=0; i<1000000++i ){
        
if( pr[i] ){
            p[pnum
++= i ;
            
for( j=i+i; j<1000000; j+=i )
                pr[j] 
= 0 ;
        }

    }

}


int mod( int n )
{
    __int64 m
=0 ;
    
int i ;
    
// 姹備綑鏁?nbsp;
    for( i=len-1; i>=0--i ){
        m 
= ( m*100000000+num[i] ) % n ;
    }

    
return m ;
}


int main()
{
    
char a[111] ;
    
int i, j, div, flag ;
    
    prime( ) ;
    
    
while( scanf("%s%d", a, &div ) && div && a[0]!='0' ){
        len 
= strlen( a ) ;
        
for( i=0; i<14++i )
            num[i] 
= 0 ;
        
for( i=0; i<len; ++i ){
            
//閫竴浜胯繘浣?nbsp;
            j = (len+7-i) / 8 - 1 ;
            num[j] 
= num[j]*10 + a[i]-'0' ;
        }

        len 
= (len+7)/8 ;
        flag 
= 1 ;
        
for( i=0; p[i]<div && i<pnum; ++i ){
            
if( mod( p[i] ) == 0 ){
                flag 
= 0 ;
                
break ;
            }

        }

        
if( flag )
            printf(
"GOOD\n") ;
        
else
            printf(
"BAD %d\n", p[i] ) ;
    }

    system(
"pause");
    
return 0 ;
}



]]>
hdu2048閿欐帓鐨勬鐜?/title><link>http://www.shnenglu.com/sunkehappy/archive/2009/05/22/83629.html</link><dc:creator>紲濅綘濂借繍錛?/dc:creator><author>紲濅綘濂借繍錛?/author><pubDate>Thu, 21 May 2009 16:02:00 GMT</pubDate><guid>http://www.shnenglu.com/sunkehappy/archive/2009/05/22/83629.html</guid><wfw:comment>http://www.shnenglu.com/sunkehappy/comments/83629.html</wfw:comment><comments>http://www.shnenglu.com/sunkehappy/archive/2009/05/22/83629.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sunkehappy/comments/commentRss/83629.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sunkehappy/services/trackbacks/83629.html</trackback:ping><description><![CDATA[<p><font size=3>          搴旇璇存槸涓涓函鏁板鐨勯鐩紝鑰冨療閿欐帓鐨勬鐜囥?/font></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> DEBUG 1</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_46_523_Open_Image onclick="this.style.display='none'; Codehighlighter1_46_523_Open_Text.style.display='none'; Codehighlighter1_46_523_Closed_Image.style.display='inline'; Codehighlighter1_46_523_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_46_523_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_46_523_Closed_Text.style.display='none'; Codehighlighter1_46_523_Open_Image.style.display='inline'; Codehighlighter1_46_523_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_46_523_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_46_523_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">#if</span><span style="COLOR: #000000"> DEBUG</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    freopen(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">C:\\Documents and Settings\\Administrator\\妗岄潰\\in.in</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">r</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,stdin) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    freopen(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">C:\\Documents and Settings\\Administrator\\妗岄潰\\out.out</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,stdout) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">#endif</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    __int64 i, n, sets, s, fenmu ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> p, temp ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%I64d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">sets ) ;<br><img id=Codehighlighter1_343_521_Open_Image onclick="this.style.display='none'; Codehighlighter1_343_521_Open_Text.style.display='none'; Codehighlighter1_343_521_Closed_Image.style.display='inline'; Codehighlighter1_343_521_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_343_521_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_343_521_Closed_Text.style.display='none'; Codehighlighter1_343_521_Open_Image.style.display='inline'; Codehighlighter1_343_521_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">( sets</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000"> )</span><span id=Codehighlighter1_343_521_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_343_521_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%I64d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">n ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        p </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        s </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        fenmu </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> ;<br><img id=Codehighlighter1_426_485_Open_Image onclick="this.style.display='none'; Codehighlighter1_426_485_Open_Text.style.display='none'; Codehighlighter1_426_485_Closed_Image.style.display='inline'; Codehighlighter1_426_485_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_426_485_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_426_485_Closed_Text.style.display='none'; Codehighlighter1_426_485_Open_Image.style.display='inline'; Codehighlighter1_426_485_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">( i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">n; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">i )</span><span id=Codehighlighter1_426_485_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_426_485_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            s </span><span style="COLOR: #000000">*=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            fenmu </span><span style="COLOR: #000000">*=</span><span style="COLOR: #000000"> i ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            p </span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000"> s</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">)fenmu ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%.2lf%%\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">100</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://www.shnenglu.com/sunkehappy/aggbug/83629.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sunkehappy/" target="_blank">紲濅綘濂借繍錛?/a> 2009-05-22 00:02 <a href="http://www.shnenglu.com/sunkehappy/archive/2009/05/22/83629.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>hdu1465 閿欐帓http://www.shnenglu.com/sunkehappy/archive/2009/05/21/83616.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Thu, 21 May 2009 15:17:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/05/21/83616.htmlhttp://www.shnenglu.com/sunkehappy/comments/83616.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/05/21/83616.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/83616.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/83616.html         榪欎竴棰樺氨鏄崟綰殑鑰冨療閿欐帓錛屼篃灝辨槸鑰冨療閫掓帹銆?/font>

鍩烘湰褰㈠紡錛歞[1]=0;   d[2]=1
閫掑綊寮忥細d[n]= (n-1)*( d[n-1] + d[n-2])

榪欏氨鏄憲鍚嶇殑閿欐帓鍏紡

 

#include <stdio.h>
#define DEBUG 1
int main()
{
    
#if DEBUG
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\in.in","r",stdin) ;
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\out.out","w",stdout) ;
    
#endif

    __int64 i, n, s, geshu, a1, a2, temp ;
    
while( EOF != scanf("%I64d"&n ) ){
        a1 
= 0 ;
        a2 
= 1 ;
        
for( i=1; i<=n; ++i ){
            temp 
= a2 ;
            a2 
= (i-1* (a1+a2) ;
            a1 
= temp ;
        }

        printf(
"%I64d\n", a2 ) ;
    }

    
return 0 ;
}

 



]]>
zoj1951_Goldbach's Conjecturehttp://www.shnenglu.com/sunkehappy/archive/2009/05/12/82703.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Tue, 12 May 2009 09:03:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/05/12/82703.htmlhttp://www.shnenglu.com/sunkehappy/comments/82703.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/05/12/82703.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/82703.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/82703.html
#include <stdio.h>
#include 
<math.h>
#define DEBUG 1
short a[1000000] ;
int main()
{
    
#if DEBUG
     freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\in.txt","r",stdin);
     freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\out.txt","w",stdout);
     
#endif
    
int i, j, n, flag ;
    
double temp ;
    
for( i=2; i<1000000++i ){
        
if( a[i] )
            
continue ;
        
for( j=i; j<1000000; j+=i )
            a[j] 
= 1 ;
        temp 
= sqrt( i ) ;
        flag 
= 1 ;
        
for( j=2; j<=temp; ++j ){
            
if( i%== 0 ){
                flag 
= 0 ;
                
break ;
            }

        }

        
if( flag )
            a[i] 
= 0 ;
    }

    
while( scanf("%d"&n ) && n ){
        
for( i=3; i<n; i+=2 ){
            
if!a[i] && !a[n-i] ){
                printf(
"%d = %d + %d\n", n, i, n-i ) ;
                
break ;
            }

        }

    }

    
return 0 ;
}



]]>
hdu2816_I Love You Toohttp://www.shnenglu.com/sunkehappy/archive/2009/05/11/82551.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Mon, 11 May 2009 04:48:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/05/11/82551.htmlhttp://www.shnenglu.com/sunkehappy/comments/82551.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/05/11/82551.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/82551.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/82551.html闃呰鍏ㄦ枃

]]>
hdu1181鍙樺艦璇?/title><link>http://www.shnenglu.com/sunkehappy/archive/2009/05/10/82506.html</link><dc:creator>紲濅綘濂借繍錛?/dc:creator><author>紲濅綘濂借繍錛?/author><pubDate>Sun, 10 May 2009 11:48:00 GMT</pubDate><guid>http://www.shnenglu.com/sunkehappy/archive/2009/05/10/82506.html</guid><wfw:comment>http://www.shnenglu.com/sunkehappy/comments/82506.html</wfw:comment><comments>http://www.shnenglu.com/sunkehappy/archive/2009/05/10/82506.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sunkehappy/comments/commentRss/82506.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sunkehappy/services/trackbacks/82506.html</trackback:ping><description><![CDATA[        鍏稿瀷鐨凢loyd浼犻掗棴鍖咃紝鍙鐭ラ亾浜嗙畻娉曪紝鍋氳搗鏉ュ拰綆鍗曘?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#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 src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">memory.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> DEBUG 1</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> N</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">28</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> map[N][N] ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> Floyd( )<br><img id=Codehighlighter1_123_265_Open_Image onclick="this.style.display='none'; Codehighlighter1_123_265_Open_Text.style.display='none'; Codehighlighter1_123_265_Closed_Image.style.display='inline'; Codehighlighter1_123_265_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_123_265_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_123_265_Closed_Text.style.display='none'; Codehighlighter1_123_265_Open_Image.style.display='inline'; Codehighlighter1_123_265_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_123_265_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_123_265_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i, j, k ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">( k</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; k</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">26</span><span style="COLOR: #000000">; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">k )<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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">26</span><span style="COLOR: #000000">; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">i )<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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">26</span><span style="COLOR: #000000">; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">j )<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        map[i][j] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map[i][j] </span><span style="COLOR: #000000">||</span><span style="COLOR: #000000"> ( map[i][k] </span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000"> map[k][j] ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_279_773_Open_Image onclick="this.style.display='none'; Codehighlighter1_279_773_Open_Text.style.display='none'; Codehighlighter1_279_773_Closed_Image.style.display='inline'; Codehighlighter1_279_773_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_279_773_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_279_773_Closed_Text.style.display='none'; Codehighlighter1_279_773_Open_Image.style.display='inline'; Codehighlighter1_279_773_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_279_773_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_279_773_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">#if</span><span style="COLOR: #000000"> DEBUG</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>     freopen(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">C:\\Documents and Settings\\Administrator\\妗岄潰\\in.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">r</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,stdin);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>     freopen(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">C:\\Documents and Settings\\Administrator\\妗岄潰\\out.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,stdout);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>     </span><span style="COLOR: #0000ff">#endif</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>     </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> len ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>     </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> a[</span><span style="COLOR: #000000">2000</span><span style="COLOR: #000000">] ;<br><img id=Codehighlighter1_535_759_Open_Image onclick="this.style.display='none'; Codehighlighter1_535_759_Open_Text.style.display='none'; Codehighlighter1_535_759_Closed_Image.style.display='inline'; Codehighlighter1_535_759_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_535_759_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_535_759_Closed_Text.style.display='none'; Codehighlighter1_535_759_Open_Image.style.display='inline'; Codehighlighter1_535_759_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>     </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">( EOF </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,a) )</span><span id=Codehighlighter1_535_759_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_535_759_Open_Text><span style="COLOR: #000000">{<br><img id=Codehighlighter1_556_698_Open_Image onclick="this.style.display='none'; Codehighlighter1_556_698_Open_Text.style.display='none'; Codehighlighter1_556_698_Closed_Image.style.display='inline'; Codehighlighter1_556_698_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_556_698_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_556_698_Closed_Text.style.display='none'; Codehighlighter1_556_698_Open_Image.style.display='inline'; Codehighlighter1_556_698_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">( a[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">] </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000"> )</span><span id=Codehighlighter1_556_698_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_556_698_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            Floyd( ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">( map[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">12</span><span style="COLOR: #000000">] )<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                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 src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                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 src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            memset( map, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, </span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000">(map) ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">continue</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        len </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> strlen( a ) ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        map[a[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">][a[len</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">a</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">1</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> ;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://www.shnenglu.com/sunkehappy/aggbug/82506.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sunkehappy/" target="_blank">紲濅綘濂借繍錛?/a> 2009-05-10 19:48 <a href="http://www.shnenglu.com/sunkehappy/archive/2009/05/10/82506.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>zoj1092_Arbitragehttp://www.shnenglu.com/sunkehappy/archive/2009/05/08/82200.html紲濅綘濂借繍錛?/dc:creator>紲濅綘濂借繍錛?/author>Thu, 07 May 2009 16:47:00 GMThttp://www.shnenglu.com/sunkehappy/archive/2009/05/08/82200.htmlhttp://www.shnenglu.com/sunkehappy/comments/82200.htmlhttp://www.shnenglu.com/sunkehappy/archive/2009/05/08/82200.html#Feedback0http://www.shnenglu.com/sunkehappy/comments/commentRss/82200.htmlhttp://www.shnenglu.com/sunkehappy/services/trackbacks/82200.html       瀵逛簬榪欎竴棰橈紝鍙鑳藉鎵懼埌涓涓《鐐癸紝璁╀粬鐨勫兼瘮1澶э紝灝辮鏄庡彲浠ラ挶鐢熼挶銆?br>
#include <stdio.h>
#include 
<string.h>
#include 
<memory.h>
#define DEBUG 1
int n ;
char mo[31][30] ;
double map[31][31] ; 

int Find( char *t )
{
    
int i ;
    
for( i=1; i<=n; ++i )
        
if!strcmp( mo[i], t ) )
            
return i ;
}


void Floyd( )
{
    
int i, j, k ;
    
for( k=1; k<=n; ++k )
        
for( i=1; i<=n; ++i )
            
for( j=1; j<=n; ++j )
                
if( map[i][j] < map[i][k]*map[k][j] )
                    map[i][j] 
= map[i][k]*map[k][j] ;
}


void In( )
{
    
int i, x, y, sets ;
    
char a[30], b[30] ;
    
double rate ;
    
for( i=1; i<=n; ++i )
           scanf(
"%s", mo[i] ) ;
    scanf(
"%d"&sets ) ;
    
for( i=1; i<=sets; ++i ){
        scanf(
"%s %lf %s", a, &rate, b ) ;
        x 
= Find( a ) ;
        y 
= Find( b ) ;
        map[x][y] 
= rate ;
    }

}


void Judge( )
{
    
int flag, i ;
    flag 
= 0 ;
    
for( i=1; i<=n; ++i ){
        
if( map[i][i] >= 1 ){
            flag 
= 1 ;
            
break ;
        }

    }

    
if( flag )
        printf(
"Yes\n") ;
    
else
        printf(
"No\n") ;    
}


int main()
{
    
#if DEBUG
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\in.in","r",stdin) ;
    freopen(
"C:\\Documents and Settings\\Administrator\\妗岄潰\\out.out","w",stdout) ;
    
#endif
    
    
int i ;
    
for( i=1; scanf("%d"&n) && n; ++i ){
        printf(
"Case %d: ", i ) ;
        memset( map, 
0sizeof(map) ) ;
        In( ) ;
        Floyd( ) ;
        Judge( ) ;
    }

    
return 0 ;
}


]]>
国内精品久久久久久中文字幕| 久久婷婷综合中文字幕| 久久综合精品国产一区二区三区| 久久久久一本毛久久久| 久久人妻AV中文字幕| 久久精品中文闷骚内射| 久久亚洲av无码精品浪潮| 中文成人无码精品久久久不卡| 久久人人爽人人爽人人片AV不| 91久久成人免费| 久久国产AVJUST麻豆| 成人免费网站久久久| 久久精品国产99国产精品亚洲| 女人香蕉久久**毛片精品| 亚洲欧美成人久久综合中文网| 国产精品免费福利久久| 日韩精品久久久久久久电影蜜臀| 一本大道加勒比久久综合| 亚洲精品无码久久毛片| 久久e热在这里只有国产中文精品99 | 狠狠干狠狠久久| 国产精品视频久久| 国产精品无码久久久久久| 久久香蕉国产线看观看精品yw| 一级做a爰片久久毛片毛片| 久久久不卡国产精品一区二区| 91超碰碰碰碰久久久久久综合| 久久久亚洲欧洲日产国码aⅴ | segui久久国产精品| 国产精品99久久久久久董美香| 久久久久中文字幕| 国产女人aaa级久久久级| 久久成人精品视频| 久久精品亚洲男人的天堂| 久久亚洲中文字幕精品一区| 亚洲中文字幕无码久久综合网| 热久久国产精品| 精品久久久久久无码国产| 亚洲国产一成久久精品国产成人综合| 成人午夜精品久久久久久久小说| 久久99亚洲综合精品首页|