TopCoder Forums RSS Feed
http://apps.topcoder.com/forums/
Most recent forum messagesenThu, 21 Jun 2018 06:07:56 -0400Re: operators and operands problem
http://apps.topcoder.com/forums/?module=Message&messageID=1666210
m = length(operands); n = length(operators); void Try(i) { for (j=0; j++; j<n) { x[i]=j; if (i==m-2) printf(operands[0],operators[x[0]],...,operators[x[m-2]],operands[m-1]); else Try(i+1); x[i]=0;} } void main(){ Try(1); }>]]>B.PhamSun, 06 Jan 2013 00:36:15 -0500Sun, 06 Jan 2013 00:36:15 -0500Sun, 06 Jan 2013 00:36:15 -0500B.Pham0operators and operands problem
http://apps.topcoder.com/forums/?module=Message&messageID=1644432
I am asking my question. I think this problem is related to Dynamic programming concept.

Problem: We have n operands and m operators. For example: operands = {a,b,c,d} operators = {*, -, +, /}

We must put operators between operands and create all of the possibility permutations. F1 = a+b+c+d F2 = a+b+c-d F2 = a+b-c-d .... Fi = a*b+c/d;

I could not implement the problem. Is there anyone help me?]]>sharifzadehTue, 27 Nov 2012 14:28:38 -0500Tue, 27 Nov 2012 14:28:38 -0500Tue, 27 Nov 2012 14:28:38 -0500sharifzadeh1