Andrew Stankevich’s Contest, Warmup
A ZOJ3362 Beer Problem 23.95% (92/384)
B ZOJ3363 Another Brick in the Wall 16.66% (1/6)
C ZOJ3364 Black and White 15.47% (41/265)
D ZOJ3365 Integer Numbers 17.54% (239/1362)
E ZOJ3366 Islands 15.70% (38/242)
F ZOJ3367 Counterfeit Money 22.22% (24/108)
G ZOJ3368 Chinese New Year 0.00% (0/23)
H ZOJ3369 Saving Princess 13.10% (68/519)
I ZOJ3370 Radio Waves 15.28% (70/458)
J ZOJ3371 Cheater’s Shuffle 11.11% (4/36)
K ZOJ3372 Gone Swimming 44.82% (13/29)

### ZOJ3362. Beer Problem

source code (ZOJ3362.cpp) [FlowNetwork, MinCostMaxFlow]

### ZOJ3363. Another Brick in the Wall

source code (ZOJ3363.cpp) [bitwise, DP, if-else]

```if (b == (b & (
(a & (a << 1)) |				// case 2
(a & c & ~(c << 1)) |			// case 3.1
((a << 1) & (c << 1) & ~c) |	// case 3.2
(a & (b << 1)) |				// case 4.1
((a << 1) & (b >> 1))			// case 4.2
))) {
if (i & 1) {
dp[i + 1][(b << n) ^ c] += dp[i][j];
} else {
dp[i + 1][(b << m) ^ (c << 1)] += dp[i][j];
}
}
```

### ZOJ3364. Black and White

source code (ZOJ3364.cpp) [area, counting, off-by-1]

### ZOJ3365. Integer Numbers

source code (ZOJ3365.cpp) [greedy]

### ZOJ3366. Islands

source code (ZOJ3366.cpp) [DisjointSet]

### ZOJ3367. Counterfeit Money

source code (ZOJ3367.cpp) [enumeration, DP, 直方图最大矩形]

### ZOJ3368. Chinese New Year

source code (ZOJ3368.cpp) [geometry, search]

### ZOJ3369. Saving Princess

dp[i][j][k]，其中i表示搞定前i个怪兽，j表示其中干了几个，那么就睡了i-j个，k表示魔，dp记录血。简单来说就是要把五维的状态降到三维，转移的时候要注意可干性和可睡性的判断。

source code (ZOJ3370.cpp) [binary search, DisjointSet]

### ZOJ3371. Cheater’s Shuffle

source code (ZOJ3371.cpp) [bidirectional search, hash]

### ZOJ3372. Gone Swimming

source code (ZOJ3372.cpp) [shortest path, simulation]

13 Responses to “Andrew Stankevich’s Contest #11解题报告”
1. Sammie says:

Passed both my MCSA and MCSE with the dumps from itlibraries, if you plan to go for a certification exam I advise using their dumps.

2. bird says:

if (i & 1) {
dp[i + 1][(b << n) ^ c] += dp[i][j];

} else {
dp[i + 1][(b << m) ^ (c << 1)] += dp[i][j];
}

请问B题的这部分代码作何解释？谢谢！

• watashi says:

m = n + 1
这个就是计数和偶数行的砖块有半块的错位

• bird says:

可是当 if (i&1) b不是应该左移m的吗？为什么 b<<

• bird says:

可是当 if (i&1) b不是应该左移m的吗？为什么 b<< n ?
还有你的代码过不了- -

3. poemelife says:

ZOJ3371. Cheater’s Shuffle

这题map过不了…无尽TLE…=.=

• watashi says:

我把我的代码稍加修改成用map的可以过，不过用了20+s
2266374 2010-08-17 22:51:05 Accepted 3371 C++ 24400 60500 watashi@Zodiac

4. 死肥羊 says:

悲剧~~错过了这场经典的比赛T-T
Saving Princess太合我胃口了。。shi哥这题的解题报告好邪恶O(∩_∩)O

5. shǎ崽 says:

B题的解法太给力了.膜拜shi哥

6. p03 says:

hope to make the 3370 more clear when using disjointset.thanks

7. Navi says:

没有人圆满-.-

8. Ramboo says:

被A题的通过率骗了的某人路过……

9.