CF984B Minesweeper

EEG信号分析实战:从时域到频域,手把手教你用Python处理脑电数据 本文详细介绍了使用Python进行EEG信号分析的实战方法,涵盖时域分析、频域分析和时频分析三大核心技术。通过MNE-Python等工具,读者将学习如何从原始脑电数据中提取事件相关电位(ERP),解码脑波节律特征,并运用时频分析追踪动态神经活动。教程包含完整的代码示例和认知科学解释,适合神经科学研究者快速掌握EEG分析全流程。 阅读详情

原题链接:http://codeforces.com/contest/984/problem/B

Minesweeper

One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that he saved world from bombs planted by terrorists, but he rarely won.

Alex has grown up since then, so he easily wins the most difficult levels. This quickly bored him, and he thought: what if the computer gave him invalid fields in the childhood and Alex could not win because of it?

He needs your help to check it.

A Minesweeper field is a rectangle n×m n × m , where each cell is either empty, or contains a digit from 1 1 to 8, or a bomb. The field is valid if for each cell:

if there is a digit k k in the cell, then exactly k neighboring cells have bombs.
if the cell is empty, then all neighboring cells have no bombs.

Two cells are neighbors if they have a common side or a corner (i. e. a cell has at most 8 8 neighboring cells).

Input

The first line contains two integers n and m(1≤n,m≤100) m ( 1 ≤ n , m ≤ 100 ) — the sizes of the field.

The next n n lines contain the description of the field. Each line contains m characters, each of them is “.” (if this cell is empty), “*” (if there is bomb in this cell), or a digit from 1 1 to 8, inclusive.

Output

Print “YES”, if the field is valid and “NO” otherwise.

You can choose the case (lower or upper) for each letter arbitrarily.

Examples
input

3 3
111
1*1
111

output

YES

input

2 4
..
1211

output

NO

Note

In the second example the answer is “NO” because, if the positions of the bombs are preserved, the first line of the field should be *2*1.

You can read more about Minesweeper in Wikipedia’s article.

题解

小小的模拟了解一下。

代码
#include<bits/stdc++.h>
using namespace std;
const int M=105;
int c1[]={0,1,1, 1, 0,-1,-1,-1};
int c2[]={1,1,0,-1,-1,-1, 0, 1};
int mmp[M][M],n,m;
char ch[M];
void in()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;++i)
    {
        scanf("%s",ch+1);
        for(int j=1;j<=m;++j)
        if(isdigit(ch[j]))mmp[i][j]=ch[j]-'0';
        else if(ch[j]=='*')mmp[i][j]=100;
    }
}
void ac()
{
    for(int i=1;i<=n;++i)
    for(int j=1,cot;j<=m;++j)
    {
        cot=0;
        if(mmp[i][j]<9)
        {
            for(int k=0;k<8;++k)if(mmp[i+c1[k]][j+c2[k]]>9)++cot;
            if(cot!=mmp[i][j])puts("NO"),exit(0);
        }
    }
    puts("YES");
}
int main(){in();ac();}
基于激光雷达的目标跟随功能移植到自己的ROS机器人小车上 提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录前言一、下载目标跟随的源码二、修改话题名称1.修改/cmd_vel话题名称2.修改/scan话题名称3.修改双电机正反转4.目标跟随功能测试 前言 本人尝试把github上的一个目标跟随项目移植到自己的机器人小车上,并且成功了,最终小车可以跟着人移动,在这里分享一下心得。基于激光雷达的目标跟随,通过获取激光雷达的信息,跟随最近的物体。 提示:以下是本篇文章正文内容,下面案例可供参考 一、下载目标跟随的源码 源码地址:https: 阅读详情

相关推荐

FreeRTOS任务调度实战:如何让STM32同时处理温湿度采集、OLED显示和云端通信

本文通过一个基于STM32的物联网终端项目,详细讲解了如何利用FreeRTOS实现多任务调度,同时处理温湿度采集、OLED显示和云端通信。文章深入探讨了任务规划、堆栈分配、信号量与消息队列等核心机制,并重点优化了ESP8266通信任务的非阻塞设计与稳定性,为构建响应迅速、运行可靠的嵌入式系统提供了实战指南。

weixin_29188043的博客 332

Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Shaburov!]

题目链接:http://codeforces.com/contest/984 A. Game time limit per test:2 seconds memory limit per test:512 megabytes input:standard input output:standard output Two pl...

di6499的博客 243

深入解析XTEA加密算法的核心机制与优化策略

本文深入解析XTEA加密算法的核心机制与优化策略,详细介绍了XTEA在嵌入式系统和资源受限环境中的优势,包括其高效的加解密速度和低资源消耗。文章还探讨了XTEA的轮函数设计、关键参数优化策略以及实战应用中的性能对比,为开发者提供了安全增强方案和优化技巧。

k8l9m0n的博客 243

Codeforces-984B - Minesweeper - 暴力

题解链接: https://lucien.ink/archives/210/ 题目链接: http://codeforces.com/contest/984/problem/B 题目: One day Alex decided to remember childhood when computers were not too powerful and lots of people...

LucienShui 987

Mac查看以太网信息,IP地址,查看配置桥接网络,使得虚拟机和本机ping通--linux系统part

4. 在本机的终端中使用ping命令,查看是否能够ping通虚拟机系统,如下图所示已经ping通。3-查看IP为192.168.1.244,还可以看到一些具体信息,如TCP/IP,DNS等;2-打开centos,进入管理员root模式(使用su命令加上输入管理员密码)然后使用ifconfig命令查看端口地址,如下所示为192.168.1.248。3-在虚拟机内使用ping命令,测试是否和网络连通,如下图所示已经ping通。打开虚拟机设置-点击网络适配器-选择桥接网络。1-打开设置,选择网络。

m0_65485230的博客 1549

动态刷新曲线_【GhPython应用】利用反射刷新Image sampler组件

【版权声明】| 作者:月之眼|案例图片来源:Sergiu Radu Pop的facebook| 如有侵权,请联系大水牛平台|如果觉得文章不错,欢迎分享效果展示利用python刷新Image sampler组件,主要的思路就是X输入端:输入要切换的图片路径,我的案例中输入了9张图片。然后通过100毫秒切换一张图片显示,来达到动态显示效果。代码分析run输入端类型:bool (I...

weixin_42393829的博客 532

984B. Minesweeper

B. Minesweepertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex decided to remember childhood when computers were not too powerful and l...

memory_qianxiao的博客 740

某音私信接口二进制解析

本文探讨了某音私信接口的二进制请求处理过程,重点分析了请求体中的非文本字符和混合编码结构。文章详细描述了编码过程,包括使用Protocol Buffers的序列化方法将结构化数据转换为字节流,并通过Uint8Array包装成二进制数组。作者展示了如何提取和补全s.encode方法,并将其转化为Base64字符串以便在Python中解码执行

码王吴彦祖的博客 903

Codeforces Round #483 [Thanks, Botan Investments and Victor Shaburov!] Editoral

T1:A. Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo players play a game.Initially there are nn integers a1,a2,…,ana1,a2,…,an written on ...

howell 448

使用Qt在FreeRTOS上构建MCU应用程序

如果我们想要在FreeRTOS上运行该应用程序,我们需要选择适用于我们处理器架构的交叉编译工具链,并将目标设备设置为我们的开发板。在该代码中,我们使用xTaskCreate()函数创建了一个名为“qt_task”的任务,并将其启动。首先,我们需要安装Qt for MCU开发环境。Qt for MCU是基于Qt 5开发的针对MCU的特殊版本,它可以生成最小体积的代码,从而适用于资源有限的嵌入式系统。如果我们想要在FreeRTOS上运行这个程序,我们需要将其包装在一个任务中,并在任务创建后启动Qt的事件循环。

ByteWhizX的博客 1815

针对小缺陷目标:在YOLOv11中引入小目标检测层

摘要: 针对YOLOv11在工业检测中漏检微小目标(如焊点气泡)的问题,研究发现深层特征下采样导致小目标信息丢失。通过在YOLOv11中增加P2检测层(4倍下采样)并融合浅层高分辨率特征,可显著提升小目标召回率。关键优化包括:调整模型结构、谨慎设计数据增强策略(减少MixUp、增加小目标粘贴)、重新分配损失权重(提升P2层权重)、优化推理速度(动态分辨率、通道裁剪)。同时强调数据质量的重要性,建议根据具体场景特性(目标尺寸、分布)定制方案,而非盲目调整模型。

as1225120794的博客 366

Codeforces Round #483 (Div. 2) B. Minesweeper

B. Minesweepertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex decided to remember childhood when computers were not too powerful and l...

恒持此志成永志 375

怎么调用onenet平台的API从而读取我们的设备数据和下发命令,做到控制开关

怎么调用onenet平台的API从而读取我们的设备数据和下发命令,做到控制开关 1、首先是怎么读取数据 读取的API是:http://api.heclouds.com/devices/datapoints?devIds=629063002 其中devids这个指的是你的设备ID 然后在我们的headers里面添加一些必要参数,就可以调用了 其中api-key的是你产品里面的master-apikey 把我们的参数写好就可以调用了,选择get方式,点击发送 这个value就是我们需要获取到的参数值了,

zyh960的博客 2万+

CF984B Minesweeper 题解( CodeForces)

给出一个扫雷地图(,让你求这个地图是否合法。直接按照题目要求,判断就好了。

lhschris的博客 460

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Minesweeper(深搜)

Minesweeper is a game available with the Windows™ operating system. The object of Minesweeper is to locate all the mines as quickly as possible without uncovering any of them. You can uncover a square

一只小菜鸡的博客 579

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

LeetCode: 529. Minesweeper

LeetCode: 529. Minesweeper

qq_16318319的博客 1380

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Codeforces Round #483 (Div. 2)题解

A. Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two players play a game. Initially there arennintegersa...

weixin_30851409的博客 433

Minesweeper

Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. 'M' represents an unrevealed mine, 'E' represents an unrevealed empty squar

ass673556617的专栏 289

第一次完整的做一场codeforces !!!!!!(Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Sha)

A. Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo players play a game.Initially there are nn integers a1,a2,…,ana1,a2,…,an written on the...

Unclebighead的博客 433

#483(div.2) B. Minesweeper

题目地址:http://codeforces.com/contest/984/problem/B题目:One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Mi...

做题记录 559

codeforces984B Minesweeper

One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that he saved worl...

adobemomo的博客 278

【AtCoder ABC 075 B】Minesweeper

【链接】 我是链接,点我呀:) 【题意】 在这里输入题意 【题解】 模拟,把#换成1 八个方向加一下就好。 【代码】 #include <bits/stdc++.h> using namespace std; const int N = 50; const int dx[8] = { 1,1,1,0,0,-1,-...

weixin_30651273的博客 240

Minesweeper(深搜)

描述: Minesweeper is a game available with the Windows™ operating system. The object of Minesweeper is to locate all the mines as quickly as possible without uncovering any of them. You can uncov

Gabriel_tzc的博客 578

Gym101915E、Minesweeper (DFS)

                                                      Minesweeper Have you ever played Minesweeper? It’s a cute little game that originates from the 1960s, and has been written for many computing pla...

Amove 616

UVa10189 Minesweeper

题目大意输入行数与列数,紧接着输入一个字符矩阵,矩阵中’.’代表没有雷,‘*‘代表雷,进行的处理是将所有的.替换为周围的雷的数目,模拟了扫雷的过程 英文原文: Have you ever played Minesweeper? It’s a cute little game which comes within a certain Operating System which name we c

besthyy的博客 629

Minesweeper问题及解法

529. Minesweeper LeetCode

刘天的博客 1333
上一篇: CF984A Game
下一篇: CF984C Finite or not?
ShadyPi
博客等级 码龄9年 1万+粉丝 637原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ShadyPi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值