山东省第七届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(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- 掌握Thinkphp3.2.0----标签库
1.什么是内置标签?什么是标签扩展库? Cx.class.php 和 Html.class.php 2.怎么加载非内置标签,怎么使用? 两种方式加载 3.怎么扩展自定义的标签? 仿照Html.clas ...
- 转一个PDevMode格式属性说明...
找不到原始来源了... //PDevMode = _devicemodeW; // _devicemodeW = record // dmDeviceName: array[0..CCHDEVICEN ...
- windows平台 查看 dll 程序集 PublicKeyToken
打开Developer Command Prompt for VS20** 命令工具 路径:点击开始->所有程序->Microsoft Visual Studio 20** ->Vi ...
- H5唤起APP一些坑
$(function () { function _openAppUrl(appUrl){ var ua = navigator.userAgent.toLocaleLowerCase(), open ...
- shell 除法 小数点
比如: num1=2 num2=3 num3=`echo "scale=2; $num1/$num2" | bc` 使用bc工具,sclae控制小数点后保留几位 还有一种方法 aw ...
- PC管理端与评委云打分配合步骤及疑难问题汇编,即如何使用PC管理端的云服务管理功能
一.前期环境及数据准备 A.PC管理端主要流程 1.进入菜单 编辑/选项/服务器 界面,如下图所示,采用我官方所提供的云服务,不采用自己假设的AppWeb服务. 切记:AppWeb服务和云服务只能二选 ...
- JSP三大指令、七大动作、九大对象
<%---------------------- JSP三大指令 -----------------------------%><%-- 1. page: language impo ...
- C#中调用user32.dll库的keybd_Event函数,操作键盘
keybd_event()的函数原型是: void keybd_event( byte bVk, //虚拟键码 byte bScan, //该键的硬件扫描码 dword ...
- WebForm 页面传值
一.使用Querystring Querystring是一种非常简单的传值方式,其缺点就是会把要传送的值显示在浏览器的地址栏中,并且在此方法中不能够传递对象.如果你想传递一个安全性不是那么太重要或者是 ...
- javascript 中的 let 作用域
let 声明了一个块级域的局部变量,并且可以给它一个初始化值. 语法EDIT let var1 [= value1] [, var2 [= value2]] [, ..., varN [= value ...