【AIM Tech Round 5 (rated, Div. 1 + Div. 2) A】 Find Square
Find div round Square Tech Rated
2023-09-14 09:03:44 时间
【链接】 我是链接,点我呀:)
【题意】
【题解】
找到左上角。往下一直走,往右一直走走到B边界就好。 中点的话。直接输出中位数【代码】
#include <bits/stdc++.h>
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define lson l,mid,rt<<1
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rs(x) scanf("%s",x)
#define rson mid+1,r,rt<<1|1
using namespace std;
const double pi = acos(-1);
const int dx[4] = {0,0,1,-1};
const int dy[4] = {1,-1,0,0};
const int N = 200;
char s[N+10][N+10];
int n,m;
int main(){
#ifdef LOCAL_DEFINE
freopen("rush_in.txt", "r", stdin);
#endif
ri(n);ri(m);
rep1(i,1,n)
rs(s[i]+1);
rep1(i,1,n){
rep1(j,1,m)
if (s[i][j]=='B'){
int ti = i,tj = j;
while (ti+1<=n && s[ti+1][j]=='B') ti++;
while (tj+1<=m && s[i][tj+1]=='B') tj++;
cout<<(i+ti)/2<<' '<<(j+tj)/2<<endl;
return 0;
}
}
return 0;
}
相关文章
- gyp ERR! stack Error: Can't find Python executable 'python'
- VBA在多个文件中Find某字符的数据并复制出来
- find
- findindex方法_find函数怎么用
- 【错误记录】Android Studio 中编写 Gradle 编译脚本时没有 Groovy 代码提示 ( Cannot find declaration to go to )
- ORA-23392: could not find materialized view to be associated with “string”.”string” ORACLE 报错 故障修复 远程处理
- ORA-23612: unable to find tablespace “string” ORACLE 报错 故障修复 远程处理
- ORA-26760: Could not find message number string for transaction with id string ORACLE 报错 故障修复 远程处理
- ORA-53012: cannot find the tag value in the metadata schema ORACLE 报错 故障修复 远程处理
- ORA-56708: Could not find any datafiles with asynchronous i/o capability ORACLE 报错 故障修复 远程处理
- 解决find命令报错: paths must precede expression详解程序员
- 上的使用使用Linux命令find寻找你想要的文件(find在linux)
- 命令探索Linux系统:使用Find命令(linux中的find)
- 使用Linux Find命令快速搜索文件(linux中find命令)
- 查找Linux Find命令:找到文件的简单方法(linuxfind)
- 通过 find 命令找到你要找的东西
- linux使用find命令查找指定文件(linux查找某文件命令)
- 管理利用Linux Find助力企业数据管理(linux find 与)
- MySQL中的Find函数快速定位数据行(mysql中find函数)
- 深入理解MySQL中的DIV函数(mysql中div)
- jQuery中filter()和find()的区别深入了解