Code Festival D Compress numbers by ciel

char a[9],b[9];i,j,c;main(){for(;~scanf("%s%s",a,b);puts(b[j]+c?"NO":"YES"))for(i=j=c=0;a[i];i++)c=(c+a[i]-48)%10,c+48==b[j]&&(j+=1,c=0);}

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

download

return to the top page