翻译

http://noi.openjudge.cn/ch0201/1661/

Bomb Game
描述
Bosko and Susko are playing an interesting game on a board made of rectangular fields arranged in A rows and B columns.
When the game starts, Susko puts its virtual pillbox in one field one the board. Then Bosko selects fields on which he will throw his virtual bombs. After each bomb, Susko will tell Bosko whether his pillbox is in the range of this bomb or not.
The range of a bomb with diameter P (P is always odd), which is thrown in field (R, S), is a square area. The center of the square is in the field (R, S), and the side of the square is parallel to the sides of the board and with length P.
After some bombs have been thrown, Bosko should find out the position of Susko's pillbox. However, the position may be not unique, and your job is to help Bosko to calculate the number of possible positions.
输入
First line of input contains three integers: A, B and K, 1 <= A, B, K <=100. A represents the number of rows, B the number of columns and K the number of thrown bombs.
Each of the next K lines contains integers R, S, P and T, describing a bomb thrown in the field at R-th row and S-th column with diameter P, 1 <= R <= A, 1 <= S <= B, 1 <= P <= 99, P is odd. If the pillbox is in the range of this bomb, T equals to 1; otherwise it is 0.
输出
Output the number of possible fields, which Susko's pillbox may stay in.

翻译
炸弹游戏
描述
Boske和Susko在一块由A行B列的矩形场地组成的棋盘上玩有趣的游戏。
当游戏开始时,Susko把它的虚拟碉堡放在棋盘的一个区域上。然后Bosko选择投掷虚拟炸弹的区域。每次爆炸后,Susko会告诉Bosko他的碉堡是否在轰炸的范围内。
炸弹轰炸的范围是直径为P(P总是奇数)的一个正方形区域,它投掷在场(R,S)中。正方形的中心在场(R,S)中和正方形的边平行板的边长度为P。
在投掷一些炸弹后,Bosko应该会发现Susko的碉堡的位置。然而,这个位置可能不是唯一的,你的工作帮助Bosko去计算可能的位置数量。
输入
第一行输入包含三个整数:A、B和K,1<=A,B,K<=100。A表示行数,B表示列数,K表示投掷的炸弹数。
接下来每K行包含整数R、S、P和T,描述一个直径为P的炸弹投掷在第R行和第S列,P为奇数。如果碉堡在这个炸弹轰炸范围内,T等于1,否则是0.
输出
输出可能的字段数,Susko的碉堡可能在其中。

posted @ 2022-01-26 00:13  zgsycbq  阅读(147)  评论(0)    收藏  举报