UVA 12503 - Robot Instructions UVA • Sep 1, 2020 Problem PDFSolution:#include #include int main() { char a[30]; int t,n,s,e,i,b[110]; while(scanf("%d",&t)==1) { while(t--) { scanf("%d",&n); s=0; for(i=1;i<=n;i++) { scanf("%s",a); if(strcmp(a,"LEFT")==0) { s-=1; b[i]=-1; } else if(strcmp(a,"RIGHT")==0) { s+=1; b[i]=1; } else { scanf("%s%d",a,&e); s+=b[e]; b[i]=b[e]; } } printf("%d\n",s); } } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12503/12503.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read