1 2 3 4 0
1 6 68 1170
There are 6 distinct expressions involving 2 operands: a+b, a-b, b-a, a*b, a/b, b/a. There are 68 distinct expressions involving 3 operands: a+b+c, a+b-c, a-b+c, a-b-c, b-a+c, b-a-c, c-a-b, a*b*c, a*b/c, a/b*c, a/b/c, b/a*c, b/a/c, c/a/b, a+b*c, b+a*c, c+a*b, a+b/c, a+c/b, b+a/c, b+c/a, c+a/b, c+b/a, a-b*c, b-a*c, c-a*b, a-b/c, a-c/b, b-a/c, b-c/a, c-a/b, c-b/a, b*c-a, a*c-b, a*b-c, b/c-a, c/b-a, a/c-b, c/a-b, a/b-c, b/a-c, a*(b+c), b*(a+c), c*(a+b), a*(b-c), a*(c-b), b*(a-c), b*(c-a), c*(a-b), c*(b-a), a/(b+c), b/(a+c), c/(a+b), a/(b-c), a/(c-b), b/(a-c), b/(c-a), c/(a-b), c/(b-a), (b+c)/a, (a+c)/b, (a+b)/c, (b-c)/a, (c-b)/a, (a-c)/b, (c-a)/b, (a-b)/c, (b-a)/c. When n=4, note that (a-b)/(c-d) and (b-a)/(d-c) are the same, but a/b-c/d and b/a-d/c are not.
Recommend | zhuweicong |
时间上限 | 内存上限 |
2000/1000MS(Java/Others) | 32768/32768K(Java/Others) |
·
·
·
·