Codeforces Round #228 (Div. 2) B. Fox and Cross
#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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- Codeforces Round #228 (Div. 2) C. Fox and Box Accumulation(贪心)
题目:http://codeforces.com/contest/389/problem/C 题意:给n个箱子,给n个箱子所能承受的重量,每个箱子的重量为1: 很简单的贪心,比赛的时候没想出来.... ...
- Codeforces Round #228 (Div. 1) 388B Fox and Minimal path
链接:http://codeforces.com/problemset/problem/388/B [题意] 给出一个整数K,构造出刚好含有K条从1到2的最短路的图. [分析] 由于是要自己构造图,当 ...
- 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 ...
- Codeforces Round #228 (Div. 2) A. Fox and Number Game
#include <iostream> #include <algorithm> #include <vector> #include <numeric> ...
- Codeforces Round #228 (Div. 2)
做codeforces以来题目最水的一次 A题: Fox and Number Game 题意:就是用一堆数字来回减,直到减到最小值为止,再把所有最小值加,求这个值 sol: 简单数论题目,直接求所有 ...
- 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 ...
随机推荐
- Android -- FragmentActivity添加Fragment的序列图
FragmentActivity添加Fragment的序列图
- location url 反向代理到来机的其它端口 gitlab
location /nexus { proxy_pass http://127.0.0.1:8081/nexus; } [root@GitMaven conf]# pwd /var/opt/gitla ...
- inode
硬盘的最小存储单位叫"扇区(sector)",每个扇区存储512字节(相当于0.5kb).系统读取硬盘时,只会读取多个sector即一个block.block 是文件存取的最小单位 ...
- Python 写Windows Service服务程序
1.需求 为什么要开发一个windows服务呢?之前做一个程序,必须要读取指定目录文件License, 因为其他程序也在读取这指定目录的License文件,且License不同时会修改License的 ...
- [LeetCode] Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). ...
- c程序辨别系统是64位 or 32位
#include <stdio.h> int main(void) { int i = 0x80000000; ){ printf("i = %d\n", i); pr ...
- C# Settings使用小结
本篇博客将介绍C#中Settings的使用. 首先介绍一个桌面程序中的例子,当我们新安装一个软件,软件启动后会有例如新手指导等窗体弹出来,每次都需要自己去关闭它.当然这些软件都会提供例如不再显示等功能 ...
- 11g新特性-如何禁用自动统计信息收集作业
一.11g中auto stats gather job被集成到了auto task中. SQL> select client_name,status from DBA_AUTOTASK_CLIE ...
- Effective C++ 之 Item 3:尽可能使用 const
Effective C++ Chapter 1. 让自己习惯C++(Accustoming Yourself to C++) Item 3. 尽可能使用 const (Use const whenev ...
- c语言的字符串操作(比较详细)
1)字符串操作 strcpy(p, p1) 复制字符串 strncpy(p, p1, n) 复制指定长度字符串 strcat(p, p1) 附加字符串 strncat(p, p1, n) 附加指定长度 ...