60: noi.ac #69
2024-09-08 11:10:53
$code$
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
using namespace std;
typedef long long LL;
int n, m;
char a[][];
bool flg[];
inline char getans(int x, int y) {
char ret = a[x][y];
if (!ret) {
ret = 'A';
while (ret == a[x - ][y] || ret == a[x + ][y] || ret == a[x][y - ] || ret == a[x][y + ]) ++ ret;
}
return ret;
}
inline void cover(int x, int y) {
char c = getans(x, y);
putchar(c);
if (a[x][y]) return;
int sz = ;
while(x + sz <= n && y + sz <= m && getans(x, y + sz) == c) {
sz ++;
}
sz --;
for (int i = x; i <= x + sz; ++ i)
for (int j = y; j <= y + sz; ++ j)
a[i][j] = c;
} int main() {
scanf("%d%d", &n, &m);
for (int i = ; i <= n; ++ i) {
for (int j = ; j <= m; ++ j)
cover(i, j);
putchar('\n');
}
}
最新文章
- 前端工程师技能之photoshop巧用系列第二篇——测量篇
- .net 应用迁移到Mono 工具 (Moma)
- 你可能不再需要Underscore
- Mac下安装zshell
- mysql innodb 数据打捞(三)innodb 簇不连接页的扫描提取(计划)
- [jAudio] JAVA上经典特征提取工具
- NPOI导入导出Excel
- html css 笔记
- Android 调用webservice faultactor 错误
- duilib绘制边框
- 理解云计算的(IaaS PaaS SaaS)
- Python面向对象编程(四)
- Mybatis JPA 代码构建
- Linux中安装opencv-3.3.1
- checkBox半选中状态
- vs code使用Git
- vtime.hpp
- 学习flask需要用到的包
- jQuery基础之一
- HBuilder+eclipse开发:使用ajax异步传值生成首字母索引
热门文章
- js/jquery键盘事件及keycode大全
- ubuntu Ifconfig只显示一个lo
- Jemeter学习环境部署。
- vue-cli 3.x版本执行vue ui命令后提示Error: Cannot find module ‘core-js/modules/es7.object.entries’报错的解决方法
- 1. vue.js介绍
- 搜索和浏览离线 Wikipedia 维基百科(中/英)数据工具
- 设计模式之JDK动态代理源码分析
- Bootstrap。
- Ansible入门笔记(3)之Playbook
- 环境搭建:添加 xgboost 到 Anaconda