CF523A.Rotate, Flip and Zoom
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Polycarp is writing the prototype of a graphic editor. He has already made up his mind that the basic image transformations in his editor will be: rotate the image 90 degrees clockwise, flip the image horizontally (symmetry relative to the vertical line, that is, the right part of the image moves to the left, and vice versa) and zooming on the image. He is sure that that there is a large number of transformations that can be expressed through these three.
He has recently stopped implementing all three transformations for monochrome images. To test this feature, he asked you to write a code that will consecutively perform three actions with a monochrome image: first it will rotate the image 90 degrees clockwise, then it will flip the image horizontally and finally, it will zoom in twice on the image (that is, it will double all the linear sizes).
Implement this feature to help Polycarp test his editor.
波利卡普正在编写一款图形编辑器的原型。他已确定,该编辑器的基本图像变换操作包括:将图像顺时针旋转 90 度、水平翻转图像(即关于竖直中线做对称变换,图像右侧移至左侧,反之亦然)以及图像缩放。他确信,大量其他变换均可通过这三种基本变换组合实现。
他最近完成了这三种变换在单色图像上的全部实现。为测试该功能,他请你编写一段代码,对一幅单色图像依次执行以下三项操作:首先将图像顺时针旋转 90 度,然后水平翻转图像,最后将图像放大两倍(即所有线性尺寸均变为原来的两倍)。
请实现该功能,以帮助波利卡普测试他的编辑器。
输入格式
The first line contains two integers, w and h (1 ≤ w, h ≤ 100) — the width and height of an image in pixels. The picture is given in h lines, each line contains w characters — each character encodes the color of the corresponding pixel of the image. The line consists only of characters "." and "*", as the image is monochrome.
第一行包含两个整数 w 和 h(1 ≤ w, h ≤ 100),分别表示图像的宽度和高度(单位:像素)。图像以 h 行的形式给出,每行包含 w 个字符——每个字符表示对应像素的颜色。该行仅由字符 . 和 * 组成,因为图像是单色的。
输出格式
Print 2_w_ lines, each containing 2_h_ characters — the result of consecutive implementing of the three transformations, described above.
输出 2w 行,每行包含 2h 个字符——即依次执行上述三种变换后得到的结果。
输入输出样例
输入#1
3 2 .*. .*.
输出#1
.... .... **** **** .... ....
输入#2
9 20 **....... ****..... ******... *******.. ..******. ....****. ......*** *.....*** ********* ********* ********* ********* ....**... ...****.. ..******. .******** ****..*** ***...*** **.....** *.......*
输出#2
********......**********........******** ********......**********........******** ********........********......********.. ********........********......********.. ..********......********....********.... ..********......********....********.... ..********......********..********...... ..********......********..********...... ....********....****************........ ....********....****************........ ....********....****************........ ....********....****************........ ......******************..**********.... ......******************..**********.... ........****************....**********.. ........****************....**********.. ............************......********** ............************......**********
输入解题思路,AI测评打分。不知道怎么写?