Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大牛进来看看,很不解我是用弗洛伊德+计算度数做的. 如果用 for(i=1;i<=N;i++) { d=0; for(j=1;j<=N;j++) { if(G[i][j]) d++; if(G[j][i]) d++; } if(d == (N-1)) ans++; } 计算就WA 改成 for(i=1;i<=N;i++) { d=0; for(j=1;j<=N;j++) { if(G[i][j]) d++; else if(G[j][i]) d++; } if(d == (N-1)) ans++; } 就AC 可题目中不是没有可能出环吗,这两套在那里不等价了? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator