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 |
太诡异了,2句写在一个循环里就RE,分别写在2个循环里就AC了~大牛来解释一下啊~谢谢了这样可以AC~ for ( i=nbs1[k]; i ;i=next1[i] ) { j = ev1[i]; if (value[j]+ew1[i]==value[k]) { dp[k][0] += dfs(j); dp[k][1] += dp[j][1]; } } for ( i=nbs1[k]; i ;i=next1[i] ) { j = ev1[i]; if ( value[j]+ew1[i] == value[k] + 1 ) { dp[k][1] += dfs(j); } } 这样就RE~ for ( i=nbs1[k]; i ;i=next1[i] ) { j = ev1[i]; if (value[j]+ew1[i]==value[k]) { dp[k][0] += dfs(j); dp[k][1] += dp[j][1]; } if ( value[j]+ew1[i] == value[k] + 1 ) { dp[k][1] += dfs(j); } } 太诡异了,2句写在一个循环里就RE,分别写在2个循环里就AC了~大牛来解释一下啊~谢谢了 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator