UVA11520 Fill the Square 枚举
来源:互联网 发布:西数移动硬盘在无网络 编辑:程序博客网 时间:2024/05/24 07:01
废话不多说,直接上代码
/************************************************************************* > File Name: \LJF\UVa\UVa_11520.cpp > Author: ljf_cnyali > Mail: 2724424647@qq.com > Last modifiedz: 2016-08-27 18:43 > Description: This is a large group of God's program information. ************************************************************************/#include<iostream>#include<cstdio>#include<cstdlib>#include<cmath>#include<cstring>#include<ctime>#include<algorithm>#include<queue>#include<set>#include<ctime>using namespace std;#define REP(i, a, b) for(int i = (a), _end_ = (b);i <= _end_; ++i)const int maxn = 20;char map[maxn][maxn];int main() { int n, m; scanf("%d", &m); int t = m; while(m--) { scanf("%d", &n); REP(i, 1, n) { getchar(); REP(j, 1, n) scanf("%c", &map[i][j]); } REP(i, 1, n) REP(j, 1, n) if(map[i][j] == '.') REP(c, 'A', 'Z') { if(i < n && c == map[i + 1][j]) continue; if(i > 1 && c == map[i - 1][j]) continue; if(j < n && c == map[i][j + 1]) continue; if(j > 1 && c == map[i][j - 1]) continue; map[i][j] = c; break; } printf("Case %d:\n", t - m); REP(i, 1, n) { REP(j, 1, n) printf("%c", map[i][j]); puts(""); }; } return 0;}
1 0
- UVA11520 Fill the Square 枚举
- UVA11520 Fill the Square 枚举
- uva11520 Fill the Square
- uva11520 Fill the Square
- Uva11520 - Fill the Square
- uva11520 - Fill the Square
- uva11520 Fill the Square
- UVa11520-Fill the Square
- uva11520 Fill the Square
- 【贪心】【uva11520】 Fill the Square
- UVA11520(p31)----Fill the Square
- UVa 11520 Fill the Square(枚举)
- uva 11520 Fill the Square(枚举)
- uva 11520 - Fill the Square(枚举,2级)
- uva 11520 - Fill the Square(贪心+枚举)
- uva 11520 - Fill the Square(贪心+枚举)
- 11520 - Fill the Square
- 11520 - Fill the Square
- AngularJS 嵌套列表
- Android中Context的含义
- Thinkphp使用create()无法向数据库添加数据
- 五年Android开发,让我“刻骨铭心”的那些坑
- 凸多边形三角剖分问题
- UVA11520 Fill the Square 枚举
- 状态模式
- CC2640之OAD固件升级(内置Flash)手动配置ImageB
- Win下 C++版SDM(Supervised Descent Method)算法实现
- 编程相关的书籍(近期阅读)
- Intent的7种属性
- 中大东校园的H3C如何在路由器上使用
- Intel汇编语言程序设计学习-第六章 条件处理-上
- mui开发需要对照这几个这几个页面进行开发