is there something wrong in this declaration:
for(j,element=min(x,y);j<max(x,y);j++)??
It looks correct. But I need to ask one thing. Have you initialized j before using for loop? If not, it contains garbage value which will lead to a Wrong answer verdict.
Use
for(j=0,element=min(x,y);j < max(x,y);j++)
or
j=0;
for(j,element=min(x,y);j < max(x,y);j++)
ok thanx!!