山东省第七届ACM省赛------The Binding of Isaac
The Binding of Isaac
Time Limit: 2000MS Memory limit: 65536K
题目描述

Ok, now I will introduce this game to you...
Isaac is trapped in a maze which has many common rooms…
Like this…There are 9 common rooms on the map.

And there is only one super-secret room. We can’t see it on the map. The super-secret room always has many special items in it. Isaac wants to find it but he doesn’t know where it is.Bob
tells him that the super-secret room is located in an empty place which is adjacent to only one common rooms.
Two rooms are called adjacent only if they share an edge. But there will be many possible places.

Now Isaac wants you to help him to find how many places may be the super-secret room.
输入
Multiple test cases. The first line contains an integer T (T<=3000), indicating the number of test case.
Each test case begins with a line containing two integers N and M (N<=100, M<=100) indicating the number
of rows and columns. N lines follow, “#” represent a common room. “.” represent an empty place.Common rooms
maybe not connect. Don’t worry, Isaac can teleport.
输出
One line per case. The number of places which may be the super-secret room.
示例输入
2 5 3 ..# .## ##. .## ##. 1 1 #
示例输出
8 4
来源
题意
#include"stdio.h"
#include"string.h"
#include<iostream>
using namespace std;
char a[105][105];
int main()
{
int n;
cin>>n;
while(n--)
{
int c,b;
cin>>c>>b;
getchar();
memset(a,0,sizeof(a));
for(int i=1; i<=c; i++)
gets(a[i]+1);
int s=0;
for(int i=0; i<=c+1; i++)
for(int j=0; j<=b+1; j++)
if(a[i][j]!='#')
{
int d=0;
if(i>0&&a[i-1][j]=='#')d++;
if(a[i+1][j]=='#')d++;
if(j>0&&a[i][j-1]=='#')d++;
if(a[i][j+1]=='#')d++;
if(d==1)s++;
}
printf("%d\n",s);
}
return 0;
}
山东省第七届ACM省赛------The Binding of Isaac的更多相关文章
- 山东省第七届ACM省赛------Memory Leak
Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...
- 山东省第七届ACM省赛------Reversed Words
Reversed Words Time Limit: 2000MS Memory limit: 131072K 题目描述 Some aliens are learning English. They ...
- 山东省第七届ACM省赛------Triple Nim
Triple Nim Time Limit: 2000MS Memory limit: 65536K 题目描述 Alice and Bob are always playing all kinds o ...
- 山东省第七届ACM省赛------Fibonacci
Fibonacci Time Limit: 2000MS Memory limit: 131072K 题目描述 Fibonacci numbers are well-known as follow: ...
- 山东省第七届ACM省赛------Julyed
Julyed Time Limit: 2000MS Memory limit: 65536K 题目描述 Julyed is preparing for her CET-6. She has N wor ...
- 山东省第七届ACM省赛
ID Title Hint A Julyed 无 B Fibonacci 打表 C Proxy 最短路径 D Swiss-system tournament 归并排序 E The Binding of ...
- 山东省第十届ACM省赛参赛后的学期总结
5.11,5.12两天的济南之旅结束了,我也参加了人生中第一次正式的acm比赛,虽然是以友情队的身份,但是我依旧十分兴奋. 其实一直想写博客来增加自己的能力的,但是一直拖到现在,正赶上老师要求写一份总 ...
- Rectangles(第七届ACM省赛原题+最长上升子序列)
题目链接: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=1255 描述 Given N (4 <= N <= 100) rec ...
- 山东理工大学第七届ACM校赛-LCM的个数 分类: 比赛 2015-06-26 10:37 18人阅读 评论(0) 收藏
LCM的个数 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 对于我们来说求两个数的LCM(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- 【php】命名空间 和 自动加载的关系
目的 本文的目的主要是说明 命名空间的 use 关键词 和 new ClassName 这两个步骤,哪个步骤才会执行自动加载,这是逻辑有点混乱的表现,这种想法也是很正常的,让我们来解密吧 命名空间(n ...
- 如何编写自己的Arduino库?
一开始写Arduino 的时候很不习惯,没有main函数,因为好多东西都被隐藏了.一直想搞清楚,以便编写自己的库文件.于是研究一下午,下面是一些总结. Arduino工程的初步认识 一.目录规范 当你 ...
- JavaScript第一天 改变DIV的样式
onmouseover 当鼠标移到这个对象之上时响应 onmouseout 当鼠标移出这个对象之上时响应 document.getElementById('id') 获取id的元素并可以做一些操作 ...
- JMeter学习-037-JMeter调试工具之四-BeanShell+jmeter.log
前面三篇文章分别讲述了 HTTP Mirror Server . Debug PostProcessor 和 Debug Samper 的脚本调试实例.此文主要讲述第四种调试方法,通过 BeanShe ...
- 导出csv文件示例
导出csv文件示例 csv文件默认以英文逗号,做为列分隔符换行符\n作为行分隔符,写入到一个.csv文件即可.含有英文逗号,和换行符会发生数据输出会出现混乱,下面列出一些处理方法.特殊字符处理1.含有 ...
- delphi 导出xml文件
procedure TfrmTallageDetail.ToolButton1Click(Sender: TObject); var Xml: TXMLDocument; Rootbusiness,R ...
- windows10搭建django1.10.3+Apache2.4
很多教程都是在linux上搭建,windows上似乎天生不太适合,但是我还是愿意试试这个坑. 首先 交代一下自己的环境 python3.5.2 64位 django 1.10.3 apache 2.4 ...
- TP框架常用(一)
25.显示最后一条查询的sql语句:主要用于在连贯操作时,检测拼接的sql语句是否正确 echo $this->db->last_query();//如:select * from pt_ ...
- SLP alpha 阶段总结
这学期快结束了,SLP的alpha阶段也结束了.在alpha版中,我实现了SLP的基础练习模块和全局设置模块,其他几个模块由于能力有限.时间有限而没有实现. 其中基础练习模块目前只能支持4/4拍,有三 ...
- Tomcat使用,部署
Tomcat服务器基本使用 web服务软件,也叫web服务器软件,web服务器. 基本使用 1)下载 到apache官网下载. http://www.apache.org 安装版本:window e ...