2014牡丹江网络预选赛B题(找规律)zoj3810
来源:互联网 发布:公司c#都转java了 编辑:程序博客网 时间:2024/04/19 11:33
An underwater volcano has erupted massively in somewhere of the deep Atlantis Ocean. This large eruption led to the birth of a new volcanic island, which had a shape of square. Near the island, there are N countries. All of them have claimed the sovereignty over the island.
After a lot of multilateral negotiation and occasional armed conflicts, the N countries decided to divide the square volcanic island equally. They partitioned the island into N x N small equal-sized square chunks. Each country could get a connected region consists of exact N chunks.
Two chunks A and B are called "connected" if they share an edge, or there exists another chunk C connected with both A and B. A group of chunks are called "connected region" if any two of these chunks are connected.
Every country want a unique region. It means the N regions should be different with each other. Two regions are considered as the same if and only if one can transform into the other by an isometry (a combination of rigid motions, including translation, rotation and reflection).
In a nutshell, your task is to divide a square island with N x N chunks into N connected regions with different shape. You also need to draw a map to color the regions of the map so that no two edge-adjacent regions have the same color. Most of the people in these countries believed that four different colors are enough. So you can mark these regions with at most four colors, red, green, blue and yellow.
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
There is only an integer N (1 <= N <= 100).
Output
For each test case, output a valid map described above. If there is no solution, output "No solution!" instead. Please note that only four colors ('R', 'G', 'B' and 'Y') can be used to drawing the map.
Sample Input
225
Sample Output
No solution!YYYGRYGGGRYGYYRBYYYRBBBBR
- 2014牡丹江网络预选赛B题(找规律)zoj3810
- ZOJ3810(2014年牡丹江网络赛B题)
- 2014牡丹江网络预选赛E题(线段树)zoj3813
- 2014牡丹江网络预选赛D题(状压DP)zoj3812
- 2014牡丹江网络预选赛I题(字符串hash+简单DP)zoj3817
- 2014牡丹江网络预选赛F题(隐式图BFS暴搜)zoj3814
- ZOJ 3809 The Himalayas (2014 ACM/ICPC 牡丹江站 网络预选赛 A 题)
- ZOJ 3818 The Himalayas (2014 ACM/ICPC 牡丹江站 网络预选赛 J 题)
- ZOJ 3810 A Volcanic Island (2014年牡丹江赛区网络赛B题)
- 2014 ACM-ICPC亚洲区域赛牡丹江站网络预选赛 CUntrusted Patrol
- HDU5573 2015 上海 B题(模拟-找规律)
- FJU2147A-B Game(找规律题)
- 找规律 B
- 2014鞍山网络预选赛1006(LCT模板题)hdu5002
- ACM Hacker (USTC1042 合肥赛区网络预选赛热身赛 B题)
- 2011ACM福州网络预选赛B题 HDU4062 Abalone
- 第十八届中山大学程序设计竞赛网络预选赛B题
- 2017武汉大学校赛网络预选赛b题
- RocketMQ原理解析-consumer 1.启动
- Redis的Java客户端Jedis的八种调用方式(事务、管道、分布式…)介绍
- POJ1007解题报告
- 重装系统Tips
- 学习JAVA第一部分总结
- 2014牡丹江网络预选赛B题(找规律)zoj3810
- 关于开通博客的一些话
- 安装jdk
- RocketMQ原理解析-consumer 2.消费端负载均衡
- Jedis使用示例
- Cocos2d-x 3.1.1 学习日志17移植出现error C1083: 无法打开包括文件:“extensions/ExtensionMacros.h”: No such file or
- MyEclipse快捷键设置及常用快捷键
- 全排列算法搜集
- HBase笔记二:Hbase Shell详解