結果

問題 No.1133 キムワイプイーター
ユーザー jj1gujjj1guj
提出日時 2020-08-20 16:31:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 455 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 13,312 KB
最終ジャッジ日時 2024-04-21 14:17:47
合計ジャッジ時間 6,985 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 141 ms
11,392 KB
testcase_03 AC 309 ms
11,900 KB
testcase_04 AC 310 ms
11,900 KB
testcase_05 AC 329 ms
12,156 KB
testcase_06 AC 323 ms
12,028 KB
testcase_07 AC 220 ms
11,520 KB
testcase_08 AC 136 ms
11,264 KB
testcase_09 AC 286 ms
12,028 KB
testcase_10 AC 455 ms
13,312 KB
testcase_11 AC 413 ms
12,928 KB
testcase_12 AC 322 ms
12,024 KB
testcase_13 AC 400 ms
12,928 KB
testcase_14 AC 307 ms
12,160 KB
testcase_15 AC 212 ms
11,520 KB
testcase_16 AC 137 ms
11,136 KB
testcase_17 AC 34 ms
10,880 KB
testcase_18 AC 40 ms
11,264 KB
testcase_19 AC 34 ms
11,008 KB
testcase_20 AC 37 ms
11,136 KB
testcase_21 AC 39 ms
11,136 KB
testcase_22 AC 39 ms
11,136 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 29 ms
10,880 KB
testcase_25 AC 33 ms
10,880 KB
testcase_26 AC 29 ms
10,752 KB
testcase_27 AC 31 ms
10,880 KB
testcase_28 AC 31 ms
10,752 KB
testcase_29 AC 29 ms
10,752 KB
testcase_30 AC 40 ms
11,264 KB
testcase_31 AC 31 ms
10,752 KB
testcase_32 AC 30 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
s=input()
n+=1

moves={"U":[-1,0],"R":[0,1],"L":[0,-1],"D":[1,0]}
G=[[1 for i in range(n)] for j in range(n)]
cn=[n-1,0]
G[cn[0]][cn[1]]=0
for k in range(m):
    cn[0]+=moves[s[k]][0]
    cn[1]+=moves[s[k]][1]
    G[cn[0]][cn[1]]=0

A=[' '.join(map(str,G[i])) for i in range(n)]
print('\n'.join(A))
0