結果

問題 No.1133 キムワイプイーター
ユーザー ThetaTheta
提出日時 2022-10-20 16:48:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 9,960 KB
最終ジャッジ日時 2023-09-12 21:40:11
合計ジャッジ時間 4,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 63 ms
8,816 KB
testcase_03 AC 130 ms
9,388 KB
testcase_04 AC 135 ms
9,448 KB
testcase_05 AC 142 ms
9,428 KB
testcase_06 AC 135 ms
9,436 KB
testcase_07 AC 97 ms
8,916 KB
testcase_08 AC 65 ms
8,776 KB
testcase_09 AC 119 ms
9,512 KB
testcase_10 AC 181 ms
9,956 KB
testcase_11 AC 166 ms
9,848 KB
testcase_12 AC 140 ms
9,512 KB
testcase_13 AC 163 ms
9,960 KB
testcase_14 AC 124 ms
9,372 KB
testcase_15 AC 88 ms
9,048 KB
testcase_16 AC 64 ms
8,904 KB
testcase_17 AC 21 ms
8,724 KB
testcase_18 AC 31 ms
8,796 KB
testcase_19 AC 22 ms
8,688 KB
testcase_20 AC 28 ms
8,772 KB
testcase_21 AC 31 ms
8,840 KB
testcase_22 AC 32 ms
8,924 KB
testcase_23 AC 16 ms
7,884 KB
testcase_24 AC 15 ms
7,812 KB
testcase_25 AC 22 ms
8,572 KB
testcase_26 AC 15 ms
7,848 KB
testcase_27 AC 16 ms
7,816 KB
testcase_28 AC 16 ms
7,824 KB
testcase_29 AC 15 ms
7,864 KB
testcase_30 AC 32 ms
8,804 KB
testcase_31 AC 15 ms
7,988 KB
testcase_32 AC 15 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, m = map(int, input().split())
    s = input()

    board = [[1 for _ in range(n+1)] for _ in range(n+1)]
    board[0][0] = 0
    current = [0, 0]
    for move in s:
        match move:
            case "R":
                current = [current[0], current[1]+1]
            case "L":
                current = [current[0], current[1]-1]
            case "U":
                current = [current[0]+1, current[1]]
            case "D":
                current = [current[0]-1, current[1]]
        board[current[0]][current[1]] = 0
    for row in reversed(board):
        print(*row)


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