結果

問題 No.1133 キムワイプイーター
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-12 11:39:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 336 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 9,788 KB
最終ジャッジ日時 2023-09-10 22:43:02
合計ジャッジ時間 6,927 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 15 ms
7,812 KB
testcase_02 AC 103 ms
8,800 KB
testcase_03 AC 229 ms
9,296 KB
testcase_04 AC 244 ms
9,448 KB
testcase_05 AC 244 ms
9,424 KB
testcase_06 AC 242 ms
9,392 KB
testcase_07 AC 167 ms
8,928 KB
testcase_08 AC 100 ms
8,664 KB
testcase_09 AC 219 ms
9,460 KB
testcase_10 AC 336 ms
9,788 KB
testcase_11 AC 303 ms
9,468 KB
testcase_12 AC 247 ms
9,412 KB
testcase_13 AC 300 ms
9,464 KB
testcase_14 AC 234 ms
9,340 KB
testcase_15 AC 157 ms
8,924 KB
testcase_16 AC 103 ms
8,748 KB
testcase_17 AC 22 ms
8,516 KB
testcase_18 AC 30 ms
8,764 KB
testcase_19 AC 21 ms
8,476 KB
testcase_20 AC 27 ms
8,476 KB
testcase_21 AC 31 ms
8,704 KB
testcase_22 AC 31 ms
8,908 KB
testcase_23 AC 16 ms
7,796 KB
testcase_24 AC 16 ms
7,836 KB
testcase_25 AC 20 ms
8,536 KB
testcase_26 AC 15 ms
7,796 KB
testcase_27 AC 15 ms
7,928 KB
testcase_28 AC 15 ms
7,836 KB
testcase_29 AC 15 ms
7,852 KB
testcase_30 AC 32 ms
8,796 KB
testcase_31 AC 15 ms
7,792 KB
testcase_32 AC 15 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
s=input()
grid=[[1]*(n+1) for _ in range(n+1)]
y=n;x=0
grid[y][x]=0
for i in range(m):
    if s[i]=='U':
        y-=1
    elif s[i]=='D':
        y+=1
    elif s[i]=='L':
        x-=1
    else:
        x+=1
    grid[y][x]=0
for i in grid:
    print(*i)
0