某岛

… : "…アッカリ~ン . .. . " .. .
February 1, 2013

Facebook Hacker Cup 2012 Round 1

External link:

http://codeforces.com/gym/100159
http://www.facebook.com/hackercup/scoreboard?round=225705397509134

Problem A. Checkpoint

Brief description:

。。我们定义到 (m, n) 的经过 (a, b) 的 2 格点路径为。。。
。从 (0, 0) 出发到 (a, b) 再到 (m, n) 的路径。。(a <= m, b <= n)。。 现在询问方案数等于 S 的二阶格点路径最少有多少步。。。。

Analysis:

… 预处理 D[x] 表示到达组合数 x 所需要的最少步数。。
。。之后将 s 分解成 a * b 即可。(。O(sqrt(s))

Problem B. Recover the Sequence

Note:

… 严格按照题目的要求递归下去就好了。。)

Problem C. Squished Status

Note:

… 暴力 DP 。。注意模数超 int。。