Code Festival B Union Find by llhuii

c;A[7<<14];main(b){for(;A[c=A[c]?:c]+A[b=A[b]?:b]||~scanf("%d%d%d",A,gets(&b),&c,*A?puts(b-c?"NO":"YES"):b-c?A[b]=c:0););}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page