結果

問題 No.1133 キムワイプイーター
ユーザー hiragnhiragn
提出日時 2022-11-22 17:30:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 11,724 KB
最終ジャッジ日時 2023-10-24 10:37:31
合計ジャッジ時間 4,976 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,036 KB
testcase_01 AC 28 ms
10,036 KB
testcase_02 AC 56 ms
10,640 KB
testcase_03 AC 94 ms
11,232 KB
testcase_04 AC 96 ms
11,272 KB
testcase_05 AC 101 ms
11,300 KB
testcase_06 AC 96 ms
11,284 KB
testcase_07 AC 77 ms
10,808 KB
testcase_08 AC 60 ms
10,604 KB
testcase_09 AC 86 ms
11,216 KB
testcase_10 AC 115 ms
11,724 KB
testcase_11 AC 110 ms
11,460 KB
testcase_12 AC 99 ms
11,288 KB
testcase_13 AC 108 ms
11,460 KB
testcase_14 AC 84 ms
11,264 KB
testcase_15 AC 67 ms
10,784 KB
testcase_16 AC 58 ms
10,624 KB
testcase_17 AC 35 ms
10,472 KB
testcase_18 AC 45 ms
10,644 KB
testcase_19 AC 36 ms
10,460 KB
testcase_20 AC 42 ms
10,404 KB
testcase_21 AC 46 ms
10,644 KB
testcase_22 AC 46 ms
10,652 KB
testcase_23 AC 28 ms
10,036 KB
testcase_24 AC 28 ms
10,036 KB
testcase_25 AC 35 ms
10,460 KB
testcase_26 AC 29 ms
10,036 KB
testcase_27 AC 28 ms
10,036 KB
testcase_28 AC 28 ms
10,036 KB
testcase_29 AC 29 ms
10,036 KB
testcase_30 AC 46 ms
10,660 KB
testcase_31 AC 29 ms
10,036 KB
testcase_32 AC 29 ms
10,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    ans = [[1] * (n + 1) for _ in range(n + 1)]
    ans[n][0] = 0
    x, y = n, 0
    for c in s:
        if c == "R":
            y += 1
        elif c == "L":
            y -= 1
        elif c == "U":
            x -= 1
        else:
            x += 1
        ans[x][y] = 0
        
    for row in ans:
        print(*row)


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