来源: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.

样例输入

5 5 3
3 3 3 1
3 4 1 0
3 4 3 1

样例输出

5

翻译: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;否则为 0。‎

输出:

‎输出可能字段的数量,Susko 的药盒可能会保留在里面。‎

pillbox 英 [ˈpɪlbɒks] 美 [ˈpɪlbɑːks]
n. (士兵的)掩体,隐蔽所,碉堡;

OpenJudge1661:Bomb Game(翻译 day 6)相关推荐

  1. 英语题目翻译——OJ_ 1661:Bomb Game

    题目:1661:Bomb Game(OpenJudge - 1661:Bomb Game) 翻译 Bosko和Susko正在一块由排成A行和B列的矩形场组成的木板上玩一个有趣的游戏. 当游戏开始时,S ...

  2. 【渝粤题库】陕西师范大学200471 英汉翻译

    <英汉翻译>作业 I. Please translate the following phrases and the underlined part in each sentence. 1 ...

  3. JAVA中fish什么意思,fish是什么意思_fish的翻译_音标_读音_用法_例句_爱词霸在线词典...

    全部 四级 六级 高考 考研 These traditional dishes include fish and chips, steak and kidney pie and large piece ...

  4. 当翻译变成了文本编辑。。。

    原文:李笑来@学习学习再学习 翻译一本书只需要一天时间! -- 这是我今天做的事情. 月初的时候,摸索了一阵 Google Cloud Translation API,过程中发现了 DeepL,直接就 ...

  5. CSAPP Bomb Lab

    CSAPP Bomb Lab bomb lab给了我们一个bomb的可执行文件,以及一个bomb.c的源文件,不过这个文件只是程序的逻辑逻辑框架,无法编译.进入bomb.c可以看到程序的流程是有6个p ...

  6. Bug heroes虫虫英雄······超详细翻译+基本攻略

    转载自:http://apple.zone.it.sohu.com/forums/thread-4588491-1-1.html 游戏真的很不错!感谢威锋[url=u-htm-action-show- ...

  7. 深入理解计算机系统bomb炸弹实验

    1. You can Russia from land here in Alaska. x /s 0x804a26c 0x804a26c:   "You can Russia from la ...

  8. Paper:《GPT-4 Technical Report》的翻译与解读

    Paper:<GPT-4 Technical Report>的翻译与解读 目录 Paper:<GPT-4 Technical Report>的翻译与解读 Abstract摘要 ...

  9. 英汉翻译词典软件代码

    Private Sub Command1_Click() Dim i, j As String Dim n As Integer i = Text1.Text For n = 1 To 6 Selec ...

  10. 新英汉翻译词典软件vb代码

    Private Sub Command1_Click() Dim i, Z As String Dim n As Integer i = Text1.Text For n = 1 To 960 Sel ...

最新文章

  1. oracle缩小表空间
  2. java 配置信息_[Java教程]java 配置信息类 Properties 的简单使用
  3. SIGIR 2021 | 深入探索犯罪情节,中科大提出基于环境感知的法律判决预测
  4. sqlite3数据库操作小记
  5. 视频容器格式与编码格式简介
  6. IOS基础之Foundation框架常用类NSFileManager,DSDate,CGPoint,CGSize,copy,单例
  7. 开灯问题---------简单模拟
  8. PHP复杂度,php 常用算法和时间复杂度
  9. python callback failed_Python请求钩子返回导致异常的值
  10. Filecoin网络目前总质押量约为2930万枚FIL
  11. 黑马Java微服务十次方项目不加密视频
  12. 电脑关机同步服务器信息失败,电脑同步,更新时间失败,怎么处理?
  13. 国产linux系统对打印机的支持,Linux系统下对打印机进行配置
  14. 12V转3.3V稳压芯片
  15. Hive---DDL
  16. NAT之server nat
  17. 浏览器提示ssl证书过期怎么办
  18. 进程的概念 | PCB的认识
  19. 卷土、玄雨入围第四届橙瓜网络文学奖十佳科幻大神,方想暂排第一
  20. Zynq-Linux移植学习笔记之52-国产ZYNQ standalone PL-PS中断调试

热门文章

  1. 数字时代带给孩子们的只有“冰冷”的科技吗?_数字体验_新浪博客
  2. 现货白银如何计算盈亏
  3. mac电脑如何查看cpu占用率?以及如何修复Mac的“ kernel_task” CPU使用率过高的Bug
  4. 带有打开密码的压缩包如何解压
  5. Java 图片压缩的学习记录
  6. win7文件夹共享 服务器,windows7共享文件夹怎么设置
  7. 百度BAE专业版申购SSL证书
  8. 什么是SaaS模式 - SaaS模式的视频会议系统
  9. 39 个奇葩代码注释,看完笑哭了。
  10. 怎样用c语言预测股票价格,如何根据时间和价格的波动来预测股票走势