# TopCoder

Adrien Wu
\begin{align} AC \times 2^9 \\ \text{New TIOJ ?} \end{align}

85.3% (29/34)

39.4% (50/127)

# Description

• 當前保留格是空的：將 $a_i$ 放入保留格，且放下 $a_{i+1}$。
• 當前保留格裝有 $a_j$ ：將 $a_j$ 放下，同時將 $a_i$ 放入保留格。

3
1 2 3

4

7
3 1 2 2 4 1 2

42

# Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 2~11 $n \leq 15$ 13
3 12~16 $\forall 1 \leq i \leq n, a_i = i$ 10
4 2~11, 17~26 $n \leq 1000$ 20
5 27~31 每一種方塊至多出現$10$次 16
6 2~42 無其他限制 41

# Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 2 4 6
3 1000 65536 65536 2 4 6
4 1000 65536 65536 2 4 6
5 1000 65536 65536 2 4 6
6 1000 65536 65536 2 4 6
7 1000 65536 65536 2 4 6
8 1000 65536 65536 2 4 6
9 1000 65536 65536 2 4 6
10 1000 65536 65536 2 4 6
11 1000 65536 65536 2 4 6
12 1000 65536 65536 3 6
13 1000 65536 65536 3 6
14 1000 65536 65536 3 6
15 1000 65536 65536 3 6
16 1000 65536 65536 3 6
17 1000 65536 65536 4 6
18 1000 65536 65536 4 6
19 1000 65536 65536 4 6
20 1000 65536 65536 4 6
21 1000 65536 65536 4 6
22 1000 65536 65536 4 6
23 1000 65536 65536 4 6
24 1000 65536 65536 4 6
25 1000 65536 65536 4 6
26 1000 65536 65536 4 6
27 1000 65536 65536 5 6
28 1000 65536 65536 5 6
29 1000 65536 65536 5 6
30 1000 65536 65536 5 6
31 1000 65536 65536 5 6
32 1000 65536 65536 6
33 1000 65536 65536 6
34 1000 65536 65536 6
35 1000 65536 65536 6
36 1000 65536 65536 6
37 1000 65536 65536 6
38 1000 65536 65536 6
39 1000 65536 65536 6
40 1000 65536 65536 6
41 1000 65536 65536 6
42 1000 65536 65536 6