結果

問題 No.565 回転拡大
ユーザー ThetaTheta
提出日時 2022-10-18 19:34:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 836 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 29,704 KB
最終ジャッジ日時 2023-09-11 11:56:40
合計ジャッジ時間 7,521 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,608 KB
testcase_01 AC 131 ms
29,532 KB
testcase_02 AC 130 ms
29,672 KB
testcase_03 AC 131 ms
29,632 KB
testcase_04 AC 132 ms
29,604 KB
testcase_05 AC 131 ms
29,668 KB
testcase_06 AC 134 ms
29,684 KB
testcase_07 AC 133 ms
29,628 KB
testcase_08 AC 132 ms
29,628 KB
testcase_09 AC 133 ms
29,656 KB
testcase_10 AC 133 ms
29,676 KB
testcase_11 AC 132 ms
29,644 KB
testcase_12 AC 131 ms
29,652 KB
testcase_13 AC 131 ms
29,672 KB
testcase_14 AC 131 ms
29,652 KB
testcase_15 AC 131 ms
29,664 KB
testcase_16 AC 132 ms
29,696 KB
testcase_17 AC 130 ms
29,664 KB
testcase_18 AC 132 ms
29,704 KB
testcase_19 AC 133 ms
29,636 KB
testcase_20 AC 133 ms
29,564 KB
testcase_21 AC 132 ms
29,680 KB
testcase_22 AC 133 ms
29,616 KB
testcase_23 AC 134 ms
29,696 KB
testcase_24 AC 132 ms
29,592 KB
testcase_25 AC 138 ms
29,632 KB
testcase_26 AC 130 ms
29,636 KB
testcase_27 AC 132 ms
29,680 KB
testcase_28 AC 132 ms
29,584 KB
testcase_29 AC 133 ms
29,488 KB
testcase_30 AC 133 ms
29,624 KB
testcase_31 AC 134 ms
29,540 KB
testcase_32 AC 132 ms
29,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def convert_str_to_binary(letter: str) -> int:
    if letter == ".":
        return 0
    if letter == "#":
        return 1
    raise ValueError


def convert_bin_to_str(bin: int) -> str:
    match bin:
        case 0:
            return "."
        case 1:
            return "#"
        case _:
            raise ValueError


def main():
    R, K = map(int, input().split())
    H, W = map(int, input().split())

    C = np.array([list(map(convert_str_to_binary, list(input())))
                 for _ in range(H)])

    C = np.rot90(C, k=-R//90)

    new_C = []
    for row in C:
        new_row = []
        for elm in row:
            new_row.extend([elm]*K)
        new_C.extend([new_row]*K)

    for row in new_C:
        print("".join(map(convert_bin_to_str, row)))


if __name__ == "__main__":
    main()
0