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 |
Re:大牛进来看看,很不解In Reply To:大牛进来看看,很不解 Posted by:superlucky at 2008-07-22 14:49:04 > 我是用弗洛伊德+计算度数做的. > 如果用 > 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 > 可题目中不是没有可能出环吗,这两套在那里不等价了? 没出现你说的情况啊,可能是你前面哪写错了吧,我把我的写法两种都试了,都ac Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator