11193 - Infinix
Posted: Tue Mar 06, 2007 1:21 am
I tried solving this one with dynamic programming but I keep getting WA. Does anybode have some tricky test cases?
If A=S=M=D=1 my program outputs 5. Is it correct?sclo wrote:did you handle cases like these properly?
1+1+1-1-1+1-1-1-1+1+1+1-1-1
Which operations could be done last?
Yesdomino wrote:If A=S=M=D=1 my program outputs 5. Is it correct?sclo wrote:did you handle cases like these properly?
1+1+1-1-1+1-1-1-1+1+1+1-1-1
Which operations could be done last?
Code: Select all
1 1 1 1
1+1+1-1-1+1-1-1-1+1+1+1-1-1
1 2 1 1
1+1+1-1-1+1-1-1-1+1+1+1-1-1
2 1 1 1
1+1+1-1-1+1-1-1-1+1+1+1-1-1
1 3 1 1
1+1+1-1-1+1-1-1-1+1+1+1-1-1
3 1 1 1
1+1+1-1-1+1-1-1-1+1+1+1-1-1
Code: Select all
5
8
8
11
12
Code: Select all
1 1 1 1
1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1
1 1 1 1
1/1/1/1/1/1/1/1/1/1/1
1 2 3 4
1/1*1/1/1*1*1/1*1
2 1 1 2
1+1+(1-(1-(1+1)-(1-1-1)+1+1+1)-1-1)
2 1 4 3
1-2/2*3+4-1*2
2 1 4 3
1+1*1-(1/1/1)*1*1/1+(1-(1+1*1)-1)/1
2 1 4 3
1+1*1*1/1-(1/1/1)+1*1/1+(1+1*1)-1/1+1
0 0 0 0
Code: Select all
5
10
13
11
11
14
13
Code: Select all
5
10
14
11
10
14
13
Code: Select all
1 2 3 4
Code: Select all
14
ForCould someone explain why ths answer is 14.
Thx anyway
Code: Select all
1 2 3 4
1/1*1/1/1*1*1/1*1