### EtaoinWu's blog

By EtaoinWu, history, 12 months ago, ,

This is the solution to this. ### Part I

1 2 3 4 5 6 7 8 9 10
D D B A D B B A D B

1 2 3 4 5

### Part III

1. Yes No No No
2. 454

### Part IV

1. 4
2. 6
3. 16
4. Output 1: 2 1 3 5 6 4 , output 2: 3 2 5 6 1 4

### Part V

There may be other equivalent solutions.

1. a[x]=i
2. i+1
3. R[a[i]]
4. a[i]
5. R[i]
1. a[i] * 0.95 <= b[i] or b[i] >= a[i] * 0.95
2. total_a >= threshold or total_a >= 50000
3. total_a + j + a[i]
4. f[j] + total_b - total_b_prefix
5. f[j-a[i]]