Bomb Game(翻译)

2022.2.7

题目网址:

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

原题:

Bomb Game​​​​​​​

总时间限制: 

1000ms

内存限制: 

65536kB

描述

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.

翻译:

描述:

Bosko和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,描述一个轰炸区域,以第R行和第S列为中心,以P为直径的圆,1<=R<=A,1<=S<=B,1<=P<=99,P是偶数。如果这个碉堡在这个轰炸范围之内,那么T等于1;否则T等于0。

输出:

输出Susko的碉堡可能在的区域的数量。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值