当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5794:A Simple Chess

题目描述
There is a $n\times m$ board, a chess want to go to the position
$(n, m)$ from the position $(1, 1)$.
The chess is able to go to position $(x_2, y_2)$ from the position $(x_1, y_1)$, only and if only $x_1, y_1, x_2, y_2$ is satisfied that $(x_2 - x_1)^2+(y_2 - y_1)^2 = 5, ~x_2 > x_1,~ y_2 > y_1$.
Unfortunately, there are some obstacles on the board. And the chess never can stay on the grid where has a obstacle.
I want you to tell me, There are how may ways the chess can achieve its goal.
输入解释
The input consists of multiple test cases.
For each test case:
The first line is three integers, $n, m, r, (1\leq n, m\leq 10^{18}, 0 \leq r\leq 100)$, denoting the height of the board, the weight of the board, and the number of the obstacles on the board.
Then follow $r$ lines, each lines have two integers, $x, y(1\leq x\leq n, 1\leq y\leq m)$, denoting the position of the obstacles. please note there aren't never a obstacles at position $(1, 1)$.
输出解释
For each test case,output a single line "Case #x: y", where x is the case number, starting from 1. And y is the answer after module $110119$.
输入样例
1 1 0
3 3 0
4 4 1
2 1
4 4 1
3 2
7 10 2
1 2
7 1
输出样例
Case #1: 1
Case #2: 0
Case #3: 2
Case #4: 1
Case #5: 5
来自杭电HDUOJ的附加信息
Author UESTC
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5794

最后修改于 2020-10-25T23:25:42+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)