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 |
Beg some propositions of my wrong codeint find(int x) { if(f[x]!=x) f[x]=find(f[x]); return f[x]; } void process() { int i,j,k,a,b; for( i=0; i<=l+10; i++ ) f[i] = i; for( k=1; k<=m; k++ ) { i = arr[k].i; j = arr[k].j; a = find(i-1); b = find(j); if( a==b ) { if( d[i-1]-d[j]!=arr[k].v ) printf("Bug Detected %d\n",d[i-1]-d[j]); else printf("Accept\n"); } else{ f[b] = a; d[b] = d[i-1]-d[j]-arr[k].v; printf("Accept\n"); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator