Andrew Stankevich’s Contest #6
ZOJ2595 Ackerman’s Function 14.93% (99/663)
ZOJ2596 The Minimal Angle 11.07% (65/587)
ZOJ2597 Yellow Code 38.21% (146/382)
ZOJ2598 Yet Another Digit 23.79% (138/580)
ZOJ2599 Graduated Lexicographical Ordering 20.99% (80/381)
ZOJ2600 GSM 20.00% (55/275)
ZOJ2601 Warehouse Keeper 14.69% (117/796)
ZOJ2602 Don’t Go Left 24.13% (49/203)
ZOJ2603 Railroad Sort 46.76% (123/263)

### ZOJ2595 Ackerman’s Function

source code (ZOJ2595.cpp) [recursion, number theory, Euler's theorem]

n\m 1 2 3 4 5
1 2 4 6 8 10 … (2m) $2 \times m$
2 2 4 8 16 32 … (2m) $2 \uparrow m$
3 2 4 16 2222 22222 … (m2) $2 \uparrow\uparrow m$
4 2 4 65536 $\begin{matrix}\underbrace{2^{2^{\cdot^{\cdot^{\cdot^2}}}}} \\ 65536 \end{matrix}$ overflow .. $2 \uparrow\uparrow\uparrow m$
5 2 4 overflow .. $2 \uparrow\uparrow\uparrow\uparrow m$ ..

### ZOJ2596 The Minimal Angle

source code (ZOJ2596.cpp) [geometry, math]

$\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}$

### ZOJ2597 Yellow Code

gray code恰好相反，yellow code相邻两个数的二进制位有一半（取下整）是不一样的，第一个和最后一个也要满足这个条件。

ans[n][i] = ans[l][i & ((1 << l) - 1)] + ans[r][(i + (i >> r)) & ((1 << r) - 1)];


### ZOJ2599 Graduated Lexicographical Ordering

source code (ZOJ2599.cpp) [DP, counting, parameter searching]

### ZOJ2600 GSM

source code (ZOJ2600.java) [math, numeric, BigDecimal]

### ZOJ2601 Warehouse Keeper

source code (ZOJ2601.cpp) [MinCostMaxFlow, bigraph, kuhnMunkres]

### ZOJ2602 Don’t Go Left

source code (ZOJ2602.cpp) [bfs, path compression]

### ZOJ2603 Railroad Sort

source code (ZOJ2603.cpp) [构造, stack, queue, deque]

6 Responses to “Andrew Stankevich’s Contest #6解题报告”
1. Calvinxiao says:

今天无意中搞了搞2603，由于太弱不会构造，发觉就是个快排啊，solve(1, (1<<n), queue q)就可以了。
ZOJ服务器升级啦？感觉judge的速度快了很多。

2. Sayakiss says:

Ackerman’s Function 表中n=4 m=3有错
2↑↑↑3=2↑↑4=65536
所给项其值是2↑↑↑4

• watashi says:

感谢指出，已fix

3. VegetableB says:

2595应该是我的最久远了吧……

• watashi says:

ym

• VegetableB says:

不是发过了么-,-

4.