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

建议使用的浏览器:

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

5336:XYZ and Drops

题目描述
XYZ is playing an interesting game called "drops". It is played on a $r * c$ grid. Each grid cell is either empty, or occupied by a waterdrop. Each waterdrop has a property "size". The waterdrop cracks when its size is larger than 4, and produces 4 small drops moving towards 4 different directions (up, down, left and right).

In every second, every small drop moves to the next cell of its direction. It is possible that multiple small drops can be at same cell, and they won't collide. Then for each cell occupied by a waterdrop, the waterdrop's size increases by the number of the small drops in this cell, and these small drops disappears.

You are given a game and a position ($x$, $y$), before the first second there is a waterdrop cracking at position ($x$, $y$). XYZ wants to know each waterdrop's status after $T$ seconds, can you help him?

$1 \le r \le 100$, $1 \le c \le 100$, $1 \le n \le 100$, $1 \le T \le 10000$
输入解释
The first line contains four integers $r$, $c$, $n$ and $T$. $n$ stands for the numbers of waterdrops at the beginning.
Each line of the following $n$ lines contains three integers $x_i$, $y_i$, $size_i$, meaning that the $i$-th waterdrop is at position ($x_i$, $y_i$) and its size is $size_i$. ($1 \le size_i \le 4$)
The next line contains two integers $x$, $y$.

It is guaranteed that all the positions in the input are distinct.

Multiple test cases (about 100 cases), please read until EOF (End Of File).
输出解释
$n$ lines. Each line contains two integers $A_i$, $B_i$:
If the $i$-th waterdrop cracks in $T$ seconds, $A_i = 0$, $B_i = $ the time when it cracked.
If the $i$-th waterdrop doesn't crack in $T$ seconds, $A_i = 1$, $B_i = $ its size after $T$ seconds.
输入样例
4 4 5 10
2 1 4
2 3 3
2 4 4
3 1 2
4 3 4
4 4
输出样例
0 5
0 3
0 2
1 3
0 1
来自杭电HDUOJ的附加信息
Author XJZX
Recommend wange2014

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

源链接: HDU-5336

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

共提交 0

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