火山喷发(volcano.cpp)
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
####【题目描述】 在一个 的网格上地图,有 座火山和 个村落。某一天,所有的火山同时喷发,喷发出的岩浆开始四处扩散。若某个格子区域内有岩浆,那么 小时后岩浆会蔓延到上下左右四个格子中。
现在,给你每座火山和每个村落的位置,请你求出每个村落会在几个小时后被岩浆淹没。若某个村落和火山在同一位置,则该时间为 。
####【输入格式】
第一行四个整数, 。
接下来 行,每行两个整数 ,表示第 座火山在第 行第 列。
接下来 行,每行两个整数 ,表示第 个村落在第 行第 列。
####【输出格式】
共B行,每行一个整数,第 行为第 个村落被岩浆淹没的时间。
####【样例输入】
5 4 2 3
1 1
5 4
3 3
5 3
2 4
####【样例输出】
3
1
3
####【数据范围】
对于 的数据,
对于 的数据,
对于 的数据, ,
20240703训练赛
- Status
- Done
- Rule
- OI
- Problem
- 4
- Start at
- 2024-7-3 16:00
- End at
- 2024-7-3 20:30
- Duration
- 4.5 hour(s)
- Host
- Partic.
- 10