zju/zoj 1276 Optimal Array Multiplication Sequence(dp)
#include
#include
#defineMIN(a,b)(a)j)
return;
if(position[i][j]){
printf("(");
putpath(i,position[i][j]);
printf("x");
putpath(position[i][j]+1,j);
putchar(')');
}
else
printf("A%d",i);
}
intmain(){