#include <iostream>
#include <string>
#include <vector>
#include <algorithm> using namespace std; int main(){
int n;
cin >> n;
vector<string> board(n);
int cnt = ;
for(int i = ; i < n; ++ i ){
cin >> board[i];
} for(int i = ; i < n-; i ++ ){
for(int j = ; j < n-; j ++ ){
if(board[i][j] == '#' && board[i-][j] == '#' &&
board[i+][j]=='#' && board[i][j-]=='#' && board[i][j+]=='#'){
board[i][j]='.';
board[i+][j]='.';
board[i-][j]='.';
board[i][j-]='.';
board[i][j+]='.';
}
}
} for(int i = ; i < n; ++i){
if(board[i].find('#')!=string::npos){
cout<<"NO"<<endl;
return ;
}
}
cout<<"YES"<<endl;
return ;
}

Codeforces Round #228 (Div. 2) B. Fox and Cross的更多相关文章

  1. Codeforces Round #228 (Div. 1) C. Fox and Card Game 博弈

    C. Fox and Card Game 题目连接: http://codeforces.com/contest/388/problem/C Description Fox Ciel is playi ...

  2. Codeforces Round #228 (Div. 1) B. Fox and Minimal path 构造

    B. Fox and Minimal path 题目连接: http://codeforces.com/contest/388/problem/B Description Fox Ciel wants ...

  3. Codeforces Round #228 (Div. 1) A. Fox and Box Accumulation 贪心

    A. Fox and Box Accumulation 题目连接: http://codeforces.com/contest/388/problem/A Description Fox Ciel h ...

  4. Codeforces Round #228 (Div. 2) C. Fox and Box Accumulation(贪心)

    题目:http://codeforces.com/contest/389/problem/C 题意:给n个箱子,给n个箱子所能承受的重量,每个箱子的重量为1: 很简单的贪心,比赛的时候没想出来.... ...

  5. Codeforces Round #228 (Div. 1) 388B Fox and Minimal path

    链接:http://codeforces.com/problemset/problem/388/B [题意] 给出一个整数K,构造出刚好含有K条从1到2的最短路的图. [分析] 由于是要自己构造图,当 ...

  6. Codeforces Round #228 (Div. 2) C. Fox and Box Accumulation

    C. Fox and Box Accumulation time limit per test 1 second memory limit per test 256 megabytes input s ...

  7. Codeforces Round #228 (Div. 2) A. Fox and Number Game

    #include <iostream> #include <algorithm> #include <vector> #include <numeric> ...

  8. Codeforces Round #228 (Div. 2)

    做codeforces以来题目最水的一次 A题: Fox and Number Game 题意:就是用一堆数字来回减,直到减到最小值为止,再把所有最小值加,求这个值 sol: 简单数论题目,直接求所有 ...

  9. Codeforces Round #290 (Div. 2) D. Fox And Jumping dp

    D. Fox And Jumping 题目连接: http://codeforces.com/contest/510/problem/D Description Fox Ciel is playing ...

随机推荐

  1. ReentrantLock和synchronized两种锁定机制

    ReentrantLock和synchronized两种锁定机制 >>应用synchronized同步锁 把代码块声明为 synchronized,使得该代码具有 原子性(atomicit ...

  2. Asp.net窄屏页面 手机端新闻列表

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchNotice.a ...

  3. 【翻译十五】-java并发之固定对象与实例

    Immutable Objects An object is considered immutable if its state cannot change after it is construct ...

  4. HTML5的input color系统颜色选择器

    前两天,我写了一篇<推荐两款jQuery色盘选择器>介绍,那是使用JavaScript实现的色盘,今天我给大家介绍HTML5的色盘选择器.HTML5有一个input类型为color,即颜色 ...

  5. DNX/ASP.NET 5的xUnit入门向导

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:想必很多人已经和我一样在使用ASP.NET 5开发真实世界的应用了,那么做好单元测试和 ...

  6. C++Primer快速浏览笔记-类型转换

    bool b = 42; // _b is true_ int i = b; // _i has value 1_ i = 3.14; // _i has value 3_ double pi = i ...

  7. APP交互

    交互设计基本功!5个值得学习的APP交互方式http://www.uisdc.com/5-interactive-design-worth-learning 移动App交互设计10大趋势–你用到了吗? ...

  8. java线程之——sleep()与wait()的区别

    sleep()是Thread的方法,wait()是Object的方法 如果线程进入了同步锁,sleep不会释放对象锁,wait会释放对象锁 sleep的作用就是让正在执行的线程主动让出CPU,给其它线 ...

  9. VPS -Digital Ocean -搭建一个最简单的web服务器

    简单的也是美的 在一个目录放自己的几个showcase网页方便和别人分享,最简单的方式是什么 创建文件夹,放入自己的网页文件 在目录下执行 $ nohup python -m SimpleHTTPSe ...

  10. [Windows驱动开发](四)内存管理

    一.内存管理概念 1. 物理内存概念(Physical Memory Address)     PC上有三条总线,分别是数据总线.地址总线和控制总线.32位CPU的寻址能力为4GB(2的32次方)个字 ...