結果

問題 No.1133 キムワイプイーター
ユーザー nohakai3nohakai3
提出日時 2022-07-20 13:40:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 342 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 1,284 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 9,888 KB
最終ジャッジ日時 2023-09-15 09:26:06
合計ジャッジ時間 7,068 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 106 ms
8,688 KB
testcase_03 AC 231 ms
9,316 KB
testcase_04 AC 241 ms
9,400 KB
testcase_05 AC 251 ms
9,384 KB
testcase_06 AC 244 ms
9,328 KB
testcase_07 AC 164 ms
8,940 KB
testcase_08 AC 98 ms
8,720 KB
testcase_09 AC 219 ms
9,288 KB
testcase_10 AC 342 ms
9,888 KB
testcase_11 AC 307 ms
9,588 KB
testcase_12 AC 253 ms
9,416 KB
testcase_13 AC 302 ms
9,592 KB
testcase_14 AC 226 ms
9,304 KB
testcase_15 AC 156 ms
8,816 KB
testcase_16 AC 104 ms
8,724 KB
testcase_17 AC 22 ms
8,440 KB
testcase_18 AC 31 ms
8,712 KB
testcase_19 AC 21 ms
8,444 KB
testcase_20 AC 27 ms
8,472 KB
testcase_21 AC 31 ms
8,688 KB
testcase_22 AC 31 ms
8,728 KB
testcase_23 AC 16 ms
7,860 KB
testcase_24 AC 16 ms
7,760 KB
testcase_25 AC 21 ms
8,532 KB
testcase_26 AC 16 ms
7,888 KB
testcase_27 AC 16 ms
7,784 KB
testcase_28 AC 16 ms
7,788 KB
testcase_29 AC 16 ms
7,860 KB
testcase_30 AC 32 ms
8,788 KB
testcase_31 AC 16 ms
7,848 KB
testcase_32 AC 15 ms
7,788 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