ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

题目翻译(2)

2022-01-17 10:33:07  阅读:165  来源: 互联网

标签:susko Susko 翻译 pillbox 题目 bosko Bosko bomb


Bomb Game(http://noi.openjudge.cn/ch0201/1661/)

描述

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,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,不在则为0.

输出

输出susko的碉堡可能的所在位置的数量。

标签:susko,Susko,翻译,pillbox,题目,bosko,Bosko,bomb
来源: https://blog.csdn.net/mn147258369_/article/details/122534540

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有