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

建议使用的浏览器:

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

6639:Faraway

题目描述
$n$ soldiers are dispatched to somewhere in Byteland. These soldiers are going to set off now, but the target location is not so clear.

Assume the target location is at $(x_e,y_e)$, it is clear that $x_e,y_e$ are both non-negative integers within $[0,m]$. For the $i$-th soldier, the only thing he knows is that $(|x_i-x_e|+|y_i-y_e|)\bmod k_i=t_i$.

To find the correct target location, these soldiers are working on the information they have now. Please write a program to figure out the number of possible target locations.
输入解释
The first line of the input contains an integer $T(1\leq T\leq 10)$, denoting the number of test cases.

In each test case, there are two integers $n,m(1\leq n\leq 10,1\leq m\leq 10^9)$ in the first line, denoting the number of soldiers and the upper bound of $x_e,y_e$.

For the next $n$ lines, each line contains four integers $x_i,y_i,k_i,t_i(0\leq x_i,y_i\leq m,2\leq k_i\leq 5,0\leq t_i<k_i)$, denoting what each soldier knows.
输出解释
For each test case, print a single line containing an integer, denoting the number of possible target locations.
输入样例
2
2 5
1 2 4 2
3 1 2 1
2 5
1 2 4 2
1 2 4 3
输出样例
10
0
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6639

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

共提交 0

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