[原创]POJ3768 较复杂分形题目

2015-12-28 17:14:17 Tabris_ 阅读数：456

https://blog.csdn.net/qq_33184171/article/details/50420183

PS：如果真的不了解分形的话，可以看看这篇博客。

2014年蓝桥杯第五题 分型问题  判断递归起点稍有不同

http://blog.csdn.net/qq_33184171/article/details/50390031

http://blog.csdn.net/qq_33184171/article/details/50274193

** Repeater **

** Time Limit: ** 1000MS

** Memory Limit: ** 65536K

** Total Submissions: ** 4187

** Accepted: ** 1114

** Description **

Harmony is indispensible in our daily lifeand no one can live without it----
may be Facer is the only exception. One dayit is rumored that repeat painting
will create harmony and then hundreds ofpeople started their endless drawing.
Their paintings were based on a smalltemplate and a simple method of
duplicating. Though Facer can easily imaginethe style of the whole picture,
but he cannot find the essential harmony. Nowyou need to help Facer by showing
the picture on computer.

You will be given a template containingonly one kind of character and spaces,
and the template shows how the endlesspicture is created----use the characters
as basic elements and put them in theright position to form a bigger template,
and then repeat and repeat doingthat. Here is an example.

#     <-template

So the Level 1 picture will be

Level 2 picture will be

##   # #
#     #
##   # #

##   # #
#     #
##   # #

** Input **

The input contains multiple test cases.
Thefirst line of each case is an integer _ N _ , representing the size of the
template is _ N _ * _ N _ ( _ N _ could only be 3, 4 or 5).
Next Nlines describe the template.
Thefollowing line contains an integer _ Q _ , which is the Scale Level of the
picture.
Inputis ended with a case of _ N _ =0.
It isguaranteed that the size of one picture will not exceed 3000*3000.

** Output **

For each test case, just print the Level _ Q _ picture by using the given
template.

** Sample Input **

3

1

3

3

4

OO

O  O

O  O

OO

2

0

** Sample Output **

#   # #        # #   #

#    #           #     #

#               #

#                 #

#   # #        # #   #

#    #           #     #

#    #

#    #

#   # #        # #   #

#    #           #     #

#               #

#                 #

#   # #        # #   #

#    #           #     #

OO OO

O OO  O

O OO  O

OO OO

OO         OO

O  O       O  O

O  O       O  O

OO         OO

OO         OO

O  O       O  O

O  O       O  O

OO         OO

OO OO

O OO  O

O OO  O

OO OO

** Source **