当前位置: 首页 > news >正文

益田附近网站建设seo点击器

益田附近网站建设,seo点击器,商标设计图案免费,建设部监理工程师考试网站CF1692C Wheres the Bishop? 题解题目链接字面描述题面翻译题目描述题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1提示代码实现题目 链接 https://www.luogu.com.cn/problem/CF1692C 字面描述 题面翻译 题目描述 有一个888\times888的棋盘,列编号从…

CF1692C Where's the Bishop? 题解

  • 题目
    • 链接
    • 字面描述
      • 题面翻译
      • 题目描述
      • 题目描述
      • 输入格式
      • 输出格式
      • 样例 #1
        • 样例输入 #1
        • 样例输出 #1
      • 提示
  • 代码实现

题目

链接

https://www.luogu.com.cn/problem/CF1692C

字面描述

题面翻译

题目描述

有一个8×88\times88×8的棋盘,列编号从左到右递增,行编号从上到下递增。

给出一个棋盘,上面用KaTeX parse error: Expected 'EOF', got '#' at position 1: #̲标明了主教的攻击范围。请你找出主教的位置坐标,并输出其行、列编号。

保证:主教的行、列编号均在222777之间。

你需要回答ttt组测试数据。 (1≤t≤36)(1\le t \le 36)(1t36)

题目描述

Mihai has an $ 8 \times 8 $ chessboard whose rows are numbered from $ 1 $ to $ 8 $ from top to bottom and whose columns are numbered from $ 1 $ to $ 8 $ from left to right.

Mihai has placed exactly one bishop on the chessboard. The bishop is not placed on the edges of the board. (In other words, the row and column of the bishop are between $ 2 $ and $ 7 $ , inclusive.)

The bishop attacks in all directions diagonally, and there is no limit to the distance which the bishop can attack. Note that the cell on which the bishop is placed is also considered attacked.

An example of a bishop on a chessboard. The squares it attacks are marked in red.Mihai has marked all squares the bishop attacks, but forgot where the bishop was! Help Mihai find the position of the bishop.

输入格式

The first line of the input contains a single integer $ t $ ( $ 1 \leq t \leq 36 $ ) — the number of test cases. The description of test cases follows. There is an empty line before each test case.

Each test case consists of $ 8 $ lines, each containing $ 8 $ characters. Each of these characters is either ‘#’ or ‘.’, denoting a square under attack and a square not under attack, respectively.

输出格式

For each test case, output two integers $ r $ and $ c $ ( $ 2 \leq r, c \leq 7 $ ) — the row and column of the bishop.

The input is generated in such a way that there is always exactly one possible location of the bishop that is not on the edge of the board.

样例 #1

样例输入 #1

3.....#..
#...#...
.#.#....
..#.....
.#.#....
#...#...
.....#..
......#.#.#.....
.#......
#.#.....
...#....
....#...
.....#..
......#.
.......#.#.....#
..#...#.
...#.#..
....#...
...#.#..
..#...#.
.#.....#
#.......

样例输出 #1

4 3
2 2
4 5

提示

The first test case is pictured in the statement. Since the bishop lies in the intersection row $ 4 $ and column $ 3 $ , the correct output is 4 3.

代码实现

遍历每一个点看他的四个角和本身是不是"#"即可

#include<bits/stdc++.h>
using namespace std;const int maxn=20;
int t;
char a[maxn][maxn];
inline bool inbound(int x,int y){return x>=1&&x<=8&&y>=1&&y<=8;}
int main(){scanf("%d",&t);while(t--){for(int i=1;i<=8;i++){for(int j=1;j<=8;j++)scanf(" %c",&a[i][j]);}bool flag=false;for(int i=1;i<=8;i++){for(int j=1;j<=8;j++){if(a[i][j]=='#'&&a[i-1][j+1]=='#'&&a[i-1][j-1]=='#'&&a[i+1][j-1]=='#'&&a[i+1][j+1]=='#'){printf("%d %d\n",i,j);break;}}if(flag)break;}}return 0;
}
http://www.mmbaike.com/news/79633.html

相关文章:

  • 下载微信公众号seo体系百科
  • 深圳罗湖企业网站建设报价免费seo网站优化
  • 网站建设合同模式互联网营销做什么
  • 男男做视频网站北京推广优化经理
  • 商城网站租服务器安全不如何去做网络推广
  • 东莞英文网站制作百度收录教程
  • 谁做网站武汉seo排名公司
  • 福州seo建站如何推广网址链接
  • 网站要怎么样做排名才上得去网络工程师培训一般多少钱
  • 高淳哪家做网站不错seo关键词排名实用软件
  • 安全的合肥网站建设网络推广营销方式
  • 北京专业网站设计推荐网络广告有哪些
  • 官方网站建设北京seo收费
  • 在家里组一个服务器做网站店铺推广
  • 全国企业信用信息系统网官网登录seo优化前景
  • 动漫制作技术和动漫设计昆明网络推广优化
  • 郑州公司网站建设哪家好成都新闻最新消息
  • 导航滑动整屏网站百度知道下载安装
  • 自己的网站做防伪码优化网站结构一般包括
  • wordpress的插件在哪无锡seo排名收费
  • .net网站与php网站关键词热度查询工具
  • php新手网站开发自己的app如何接广告
  • 寻找大连网站建设品牌关键词优化
  • 做网站有必要宁波网站建设优化企业
  • 怎么写网站建设与运营长沙建站工作室
  • 表格比较多得网站这么做响应式免费做网站网站
  • 公司网站设计 杭州 推荐seo技术培训班
  • 想自己做网站推广大量微信群推广代发广告
  • 河北建设教育培训网站百度推广竞价是什么意思
  • 淄博 网站运营友情链接交易网站源码