結果

問題 No.565 回転拡大
ユーザー htkb
提出日時 2017-09-08 23:22:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-07 06:40:05
合計ジャッジ時間 2,245 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

R, K = map(int, input().split())
H, W = map(int, input().split())
AH, AW = (H*K, W*K) if R == 0 or R == 180 else (W*K, H*K)

a = [tuple(input()) for _ in [0]*H]
ans = [["*"]*AW for _ in [0]*AH]

for _y in range(H*K):
    y = _y//K
    for _x in range(W*K):
        x = _x//K
        if R == 0:
            ans[_y][_x] = a[y][x]
        elif R == 90:
            ans[_x][-_y-1] = a[y][x]
        elif R == 180:
            ans[-_y-1][-_x-1] = a[y][x]
        else:
            ans[_x][-_y-1] = a[y][x]


for i in range(AH):
    print("".join(ans[i]))
0