結果

問題 No.565 回転拡大
ユーザー kichirb3kichirb3
提出日時 2018-03-24 12:52:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 1,044 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 8,384 KB
最終ジャッジ日時 2023-09-07 08:25:10
合計ジャッジ時間 1,961 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,244 KB
testcase_01 AC 17 ms
8,196 KB
testcase_02 AC 16 ms
8,200 KB
testcase_03 AC 16 ms
8,212 KB
testcase_04 AC 16 ms
8,184 KB
testcase_05 AC 17 ms
8,256 KB
testcase_06 AC 16 ms
8,220 KB
testcase_07 AC 17 ms
8,324 KB
testcase_08 AC 16 ms
8,324 KB
testcase_09 AC 17 ms
8,264 KB
testcase_10 AC 16 ms
8,352 KB
testcase_11 AC 16 ms
8,260 KB
testcase_12 AC 17 ms
8,208 KB
testcase_13 AC 16 ms
8,188 KB
testcase_14 AC 17 ms
8,252 KB
testcase_15 AC 17 ms
8,284 KB
testcase_16 AC 17 ms
8,264 KB
testcase_17 AC 17 ms
8,256 KB
testcase_18 AC 17 ms
8,384 KB
testcase_19 AC 16 ms
8,348 KB
testcase_20 AC 16 ms
8,220 KB
testcase_21 AC 16 ms
8,276 KB
testcase_22 AC 16 ms
7,748 KB
testcase_23 AC 16 ms
8,256 KB
testcase_24 AC 17 ms
8,300 KB
testcase_25 AC 17 ms
7,780 KB
testcase_26 AC 16 ms
8,188 KB
testcase_27 AC 16 ms
7,860 KB
testcase_28 AC 17 ms
8,220 KB
testcase_29 AC 16 ms
8,332 KB
testcase_30 AC 16 ms
8,288 KB
testcase_31 AC 16 ms
8,224 KB
testcase_32 AC 16 ms
8,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.565 回転拡大
https://yukicoder.me/problems/no/565

"""
import sys
from sys import stdin
input = stdin.readline


def rotate_pict(R, pict):
    H = len(pict)
    W = len(pict[0])
    if R == 90 or R == 270:
        H, W = W, H
    rpict = [['.']* W for _ in range(H)]

    for y in range(H):
        for x in range(W):
            if R == 0:
                rpict[y][x] = pict[y][x]
            elif R == 180:
                rpict[y][x] = pict[H-y-1][W-x-1]
            elif R == 90:
                rpict[y][x] = pict[W-x-1][y]
            elif R == 270:
                rpict[y][x] = pict[x][H-y-1]
    return rpict


def main(args):
    R, K = map(int, input().split())
    H, W = map(int, input().split())
    pict = []
    for _ in range(H):
        pict.append(list(input().strip()))

    rpict = rotate_pict(R, pict)
    for row in rpict:
        for i in range(K):
            for r in row:
                print(r * K, end='')
            print()



if __name__ == '__main__':
    main(sys.argv[1:])
0