結果

問題 No.1133 キムワイプイーター
ユーザー kikagekikage
提出日時 2021-08-16 17:09:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 679 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 12,664 KB
最終ジャッジ日時 2024-04-17 20:20:35
合計ジャッジ時間 8,990 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 216 ms
11,392 KB
testcase_03 AC 468 ms
12,156 KB
testcase_04 AC 492 ms
12,156 KB
testcase_05 AC 540 ms
12,156 KB
testcase_06 AC 496 ms
12,160 KB
testcase_07 AC 355 ms
11,640 KB
testcase_08 AC 222 ms
11,520 KB
testcase_09 AC 423 ms
12,152 KB
testcase_10 AC 679 ms
12,664 KB
testcase_11 AC 605 ms
12,664 KB
testcase_12 AC 503 ms
12,160 KB
testcase_13 AC 587 ms
12,540 KB
testcase_14 AC 444 ms
12,156 KB
testcase_15 AC 300 ms
11,648 KB
testcase_16 AC 214 ms
11,440 KB
testcase_17 AC 52 ms
11,264 KB
testcase_18 AC 89 ms
11,520 KB
testcase_19 AC 50 ms
11,264 KB
testcase_20 AC 75 ms
11,392 KB
testcase_21 AC 86 ms
11,520 KB
testcase_22 AC 90 ms
11,520 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 29 ms
10,752 KB
testcase_25 AC 48 ms
11,264 KB
testcase_26 AC 28 ms
10,752 KB
testcase_27 AC 28 ms
10,752 KB
testcase_28 AC 28 ms
10,752 KB
testcase_29 AC 28 ms
10,752 KB
testcase_30 AC 90 ms
11,648 KB
testcase_31 AC 28 ms
10,752 KB
testcase_32 AC 28 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a,b=0,0
s=input()

D=[[1 for y in range(n+1)]for x in range(n+1)]


D[0][0]=0
for i in range(m):
    if s[i]=="U":a,b=a,b+1
    if s[i]=="R":a,b=a+1,b
    if s[i]=="L":a,b=a-1,b
    if s[i]=="D":a,b=a,b-1
        
    if 0<=a<=n and 0<=b<=n:
        D[a][b]=0



for y in range(n+1):
    for x in range(n+1):
        if x>0:print(" ",end="")
        print(D[x][n-y],end="")
    
    print("")
0