Oil Deposits (深搜)

BUSCO评估基因组的完整性 因为数据库收集的时候找的就是在不同的物种间都是单拷贝的基因,所以说在评估的物种里面应该也是单拷贝的状态才对。基因组层面评估:先去基因组上预测这些基因,再去做评估,如果说给他是一个注释好的基因集,这个时候提供的是一个蛋白集合,它就直接是去进行同源搜索,再去评估,看BUSCO数据库里面的这些单拷贝基因有或者无;首先,tblastn也是同源搜索,同源搜索之后,去对转录本进行读码框预测,预测完的结果还是去进行hmmsearch的搜索(hmmsearch是做蛋白质结构域搜索的),最终拿到BUSCO评估结果。 阅读详情

The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing equipment to determine whether or not the plot contains oil. A plot containing oil is called a pocket. If two pockets are adjacent, then they are part of the same oil deposit. Oil deposits can be quite large and may contain numerous pockets. Your job is to determine how many different oil deposits are contained in a grid.

input

The input file contains one or more grids. Each grid begins with a line containing m and n, the number of rows and columns in the grid, separated by a single space. If m = 0 it signals the end of the input; otherwise 1 <= m <= 100 and 1 <= n <= 100. Following this are m lines of n characters each (not counting the end-of-line characters). Each character corresponds to one plot, and is either `*', representing the absence of oil, or `@', representing an oil pocket.

output

For each grid, output the number of distinct oil deposits. Two different pockets are part of the same oil deposit if they are adjacent horizontally, vertically, or diagonally. An oil deposit will not contain more than 100 pockets.

sample input

1 1
*
3 5
*@*@*
**@**
*@*@*
1 8
@@****@*
5 5 
****@
*@@*@
*@**@
@@@*@
@@**@
0 0

sample output

0
1
2
2

题意:这题可以说是搜索中最基础的一题之一。 要找出相连在一起的有多少块, 
分析:依次枚举,遇到@时就进行搜索,用深搜,广搜应该都行,目的是把相连的@都标记为已访问。
下面给出用DFS的代码,最坑的是最后还有一个换行 ,要用\n或者%*c。

#include<cstdio>  
#include<cstring>  
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
char map[105][105],mat[105][105],vis[105][105];  
void dfs(int i,int j)  
{  
    if(vis[i][j]||mat[i][j]=='*')  
    return ;  
    vis[i][j]=1;  
    dfs(i-1,j-1);  
    dfs(i-1,j);  
    dfs(i-1,j+1);  
    dfs(i,j-1);  
    dfs(i,j+1);  
    dfs(i+1,j-1);  
    dfs(i+1,j);  
    dfs(i+1,j+1);  
}  
int main()  
{  
    int n,m;  
    while(~scanf("%d %d\n",&n,&m))  
    {  
        memset(map,0,sizeof(map));  
        memset(mat,'*',sizeof(mat));  
        memset(vis,0,sizeof(vis));  
        int i,j,cnt = 0;  
        if(!m&&!n)  
        break;  
        for(i = 0;i<n;i++)  
        {  
            for(j = 0;j<m;j++)  
            {  
                scanf("%c",&map[i][j]);  
                mat[i+1][j+1]=map[i][j];  
            }  
            getchar();  
        }  
        for(i = 1 ;i<=n;i++)  
        {  
            for(j = 1;j<=m;j++)  
            {  
                if(!vis[i][j]&&mat[i][j] == '@')  
                {  
                    dfs(i,j);  
                    cnt++;  
                }  
            }  
        }  
        printf("%d\n",cnt);  
    }  
}  


自动化革命:AI在需求分析、代码生成与测试中的深度应用 在2025年的科技浪潮中,人工智能(AI)已不再是实验室中的概念,而是深度渗透至软件开发的全生命周期。从需求分析的精准捕捉,到代码生成的自动化创作,再到测试环节的智能覆盖,AI正以革命性姿态重塑软件工程的核心环节。本文将结合2025年最新数据与行业实践,解析AI如何在这三大领域实现深度应用。 阅读详情

相关推荐

llama.cpp部署大模型

llama.cpp如何部署大模型

Eddy的博客 976

Oil Deposits 挖油题——深度优先搜索(deep first search)

先感谢一下远航大佬踩坑,广搜无限tl和wa还d不出来,用深搜就一遍过了。 先上题目(中文版吧) 口述题目环节 题意:输入行列数,输入一个地图,"@“代表有油,” * “没油。每个”@“的八个方向有”@"连着的话属于同一个油层。判断有多少个油层。 代码详解环节 1、全局部分 int m,n; char map[120][120]; int fangxiang[8][2]= {{-1,-1},{-...

qq_45716735的博客 410

STM32L476低功耗实战:LPTIM精准定时唤醒STOP2模式与系统级功耗优化

本文深入探讨了STM32L476低功耗实战技巧,重点解析了LPTIM精准定时唤醒STOP2模式的配置与优化。通过详细的步骤指南和实战经验分享,帮助开发者实现系统级功耗优化,特别适合电池供电设备开发。文章涵盖LPTIM1定时器配置、STOP2模式进入流程及常见问题排查,助力将整机功耗降至8.2uA级别。

weixin_33686714的博客 435

Oil Deposits 油田问题(基础DFS深搜)

GeoSurvComp地质调查公司负责探测地下石油储量。GeoSurvComp 一次与一个大型矩形土地区域配合工作,并创建一个网格,将土地划分为多个方块。然后,它分别分析每个绘图,使用感应设备确定该地块是否含有油。含有油的地块称为口袋。如果两个口袋相邻,则它们是同一油藏的一部分。石油储量可能相当大,可能含有许多口袋。您的工作是确定网格中包含多少不同的油藏。 输入 输入包含一个或多个网格。每个网格以包含 m 和 n 的线开始,网格中的行和柱数由单个空间分开。如果m=0它表示输入的结束:否则 1...

m0_58245389的博客 1871

Agent框架系列:1-低代码智能体平台深度解析Dify、Coze、n8n

Dify、Coze 和 n8n 是三大主流低代码智能体平台,各有侧重。Dify 适合企业级 AI 应用,具备强大的 RAG 和知识库管理能力,技术栈为 Python + React。Coze 由字节推出,主打零代码和快速原型开发,集成 60+ 插件,极适合非技术用户。n8n 以工作流自动化和系统集成为核心,支持 400+ 外部应用,基于 Node.js + Vue,扩展性极强。选择建议:非技术团队选 Coze,AI 应用选 Dify,复杂自动化与集成选 n8n。可根据实际需求混合使用,最大化平台优势。

3081

记一次Nacos线程数飙升排查

Nacos线程飙升问题排查

叭嘣的博客 2631

HDU-1241 Oil Deposits(DFS深搜)

VJ题目链接: https://cn.vjudge.net/problem/HDU-1241 题目信息,先干为敬 背景描述 ztw 同志负责探测地下石油储藏。 ztw现在在一块矩形区域探测石油。他通过专业设备,来分析每个小块中是否蕴藏石油。如果这些蕴藏石油的小方格相邻(横向相邻,纵向相邻,还有对角相邻),那么它们被认为是同一油藏的一部分。在这块矩形区域,可能有很多油藏。你的任务是确定有多少不同的油...

A's World 925

保姆级教程:用CameraX API快速搞定Android多摄像头切换与预览(附避坑指南)

本文提供了一份详细的CameraX API教程,帮助开发者快速实现Android多摄像头切换与预览功能。通过简化API设计和生命周期感知能力,CameraX大幅降低了开发复杂度,同时解决了多摄像头兼容性、预览优化等常见问题。文章包含完整代码示例和实战避坑指南,特别适合需要高效集成相机功能的Android开发者。

weixin_42699679的博客 166

Oil Deposits ——简单深搜

The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th...

mumei的博客 283

超声波雷达探测车位及信号处理方法

在APA泊车中用到了超声波雷达,第一次接触,总结研究之。

周陽讀書 1229

核心组件大换血:Backbone与Neck魔改篇:YOLO26结合StarNet结构:2026星状网络在YOLO生态的即插即用实战

本文将介绍如何将StarNet作为Backbone替换YOLO26原生架构,以提升边缘设备上的目标检测性能。文章首先分析了YOLO26在特定场景下的精度瓶颈,指出其通用Backbone设计存在不足。随后深入解析StarNet的核心创新——星操作(Star Operation),这一低维计算却能获得高维特征表达的数学魔术,以及其极简的StarBlock模块设计。通过对比YOLO26原生架构的三大创新与痛点,作者提出两种替换策略:完整替换Backbone或局部替换+Neck联调。文中提供了StarNet核心代码

ZDQ58818的博客 289

Oil Deposits【深搜】

Oil Deposits  HDU - 1241  The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and cr...

C++的星空 429

【Python_PySide6学习笔记(二十四)】菜单栏QMenuBar类的基本用法

此篇文章中介绍 PySide6 中 QMenuBar 类的基本用法,包括"创建菜单栏"、"创建一级菜单"、"创建二级菜单"等,会持续更新,有需要的读者可以点赞收藏,也欢迎在评论区进行讨论。

禾戊之昂的博客 1623

oil deposits——深搜

Oil Deposits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22313 Accepted Submission(s): 12865Problem Description The GeoSurvComp geolog

StubbornAccepted的博客 560

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Oil Deposits(DFS深搜)

题面:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes e

qq_74775184的博客 1069

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

深搜之入门例题 DFS Oil Deposits

Oil Deposits   题意:@是一个油田,如果它周围的8个方向有一个是油田的话,那么这两个油田是一块。问:这样的油田有多少块?思路: 因为这里的每一个地方都需要搜索判断, 所以采用深搜。#include #include #include #include #include #include #include #include #define me(a) m

qq_37763788的博客 283

Oil Deposits(深搜)

问题描述: GeoSurvComp地质调查公司负责检测地下油藏.GeoSurvComp一次与一个大的矩形区域一起工作,并创建一个网格,将网格划分为多个方块.然后分别分析每个地块,使用传感设备确定该地块是否含有油.含油的情节被称为口袋.如果两个口袋相邻,则它们是同一个油藏的一部分.油藏可能相当大,可能含有大量的口袋.你的工作是确定网格中包含多少个不同的油藏. 输入: 输入文件包含一个或多个网格.每个...

eve_n的博客 363

Oil Deposits(dfs深搜)

Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates

Scarlett_geng的博客 836

hdu 1241 Oil Deposits(深搜)

题目地址 题目大意:一个nxm的字母矩阵只包含“@‘和’*‘,求有多少个@块(八个方向相连为一个@块) 解题思路:对每个@出现的地方进行深搜,将其周围满足条件的都替换成’*‘,直到矩阵中没有@,深搜了几次说明有几个@块 #include #include #include #include #include #include #include #include #includ

booyoungxu的专栏 294

POJ 1562Oil Deposits深搜

DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that

肖火柴的火柴盒 284

poj 1562: Oil Deposits(递归深搜)

题目来源:http://poj.org/problem?id=1562之前在hdoj上写了一个基于vector的深搜点击打开链接,当时是为了和宽搜对比,都用了vector而没有用递归。其实递归的深搜思路更清晰更具有可扩展性,所以在这里又写了一个递归的深搜。Oil DepositsTime Limit: 1000MS Memory Limit: 10000K DescriptionThe Ge...

da_kao_la的博客 399

hdu1241 Oil Deposits dfs深搜水题

Oil DepositsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36869    Accepted Submission(s): 21364Problem DescriptionThe GeoSurvComp geologic su...

bestsort 528

HDU1241 Oil Deposits(深搜DFS)

题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 题意:          一个方形区域内里寻找有多少个油田,挨着的算一个(上下,左右,以及对角)。 分析:        简单的深搜不解释了,看代码 吧。 代码: #include&lt;cstdio&gt; #include&lt;iostream&gt; #include&lt...

Sean 297

杭电1241——Oil Deposits(深搜dfs)

这种题相信研究过dfs的都做过,这种是非常典型的一类深搜题,深搜0ms水过啊 话不多说,一言不合上代码: #include #include #include #include #include using namespace std; #define N 108 //不要问我为什么108这个数,比较吉利 int n,m,vis[N][N],res; char room[

mcu旺仔acm的博客 543

Oil Deposits(DFS)

Oil Deposits The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then

Eagle222的博客 243

HDU 1241 Oil Deposits(深搜)

Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and cr...

red_red_red的博客 602

Oil Deposits (深搜(水))

题目来源:https://vjudge.net/contest/159739#problem/L 【题意】 题意里叙述了这么一种关系,@的上下左右斜只要是@,那么这两个就可以视为同一种,问共有多少种@。 【思路】 深搜,@的周围只要是@,继续深搜,搜过的标记。 【代码】#include<map> #include<stack> #include<queue> #include<cstdio

Crazy 657
上一篇: Til the Cows Come Home(最短路—Dijkstra算法)
下一篇: 畅通工程(并查集)
vizard_
博客等级 码龄9年 6粉丝 31原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值