結果

問題 No.1434 Make Maze
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-03-19 22:24:08
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,640 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 83,968 KB
最終ジャッジ日時 2024-04-29 17:28:38
合計ジャッジ時間 6,229 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,352 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 137 ms
83,712 KB
testcase_03 AC 137 ms
83,968 KB
testcase_04 AC 38 ms
52,224 KB
testcase_05 RE -
testcase_06 AC 41 ms
52,096 KB
testcase_07 AC 40 ms
52,480 KB
testcase_08 WA -
testcase_09 RE -
testcase_10 AC 38 ms
52,224 KB
testcase_11 AC 38 ms
52,352 KB
testcase_12 AC 53 ms
62,976 KB
testcase_13 WA -
testcase_14 AC 51 ms
62,336 KB
testcase_15 AC 59 ms
65,792 KB
testcase_16 AC 49 ms
62,976 KB
testcase_17 AC 51 ms
61,824 KB
testcase_18 AC 57 ms
64,128 KB
testcase_19 AC 68 ms
68,352 KB
testcase_20 RE -
testcase_21 AC 38 ms
52,352 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 70 ms
67,072 KB
testcase_25 AC 71 ms
69,760 KB
testcase_26 AC 52 ms
61,952 KB
testcase_27 AC 69 ms
66,432 KB
testcase_28 AC 55 ms
63,232 KB
testcase_29 AC 47 ms
60,160 KB
testcase_30 AC 59 ms
63,488 KB
testcase_31 AC 57 ms
62,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""



"""

import sys
from sys import stdin

H,W,X = map(int,stdin.readline().split())
ox = X

if X % 2 == 1:
    print (-1)
    sys.exit()


S = [["."] * W for i in range(H)]
for j in range(1,W,2):
    for i in range(H):
        S[i][j] = "#"

inst = ["D"] * (H-1) + ["R"] * 2 + ["U"] * (H-1) + ["R"] * 2
x = 0
y = 0
cnt = 0
while True:

    #print (x,y)
    if x > H or y > W or x < 0 or y < 0:
        break

    if (H-1-x) + (W-1-y) == X and x%2 == 0 and y%2==0:
        while y < W-1:
            S[x][y] = "."
            y += 1
        while x < H-1:
            S[x][y] = "."
            x += 1
        for i in S:
            print ("".join(i))
        sys.exit()

    S[x][y] = "."
    if inst[cnt % len(inst)] == "D":
        x += 1
    elif inst[cnt % len(inst)] == "R":
        y += 1
    elif inst[cnt % len(inst)] == "U":
        x -= 1
    else:
        y -= 1
    X -= 1
    cnt += 1

print ("Second",file=sys.stderr)

X = ox
S = [["."] * W for i in range(H)]
inst = ["R"] * (W-1) + ["D"] * 2 + ["L"] * (W-1) + ["D"] * 2
x = 0
y = 0
cnt = 0
while True:

    if x > H or y > W or x < 0 or y < 0:
        break

    if (H-1-x) + (W-1-y) == X and x%2 == 0 and y%2==0:
        while x < H-1:
            S[x][y] = "."
            x += 1
        while y < W-1:
            S[x][y] = "."
            y += 1 
        for i in S:
            print ("".join(i))
        sys.exit()

    S[x][y] = "."
    if inst[cnt % len(inst)] == "D":
        x += 1
    elif inst[cnt % len(inst)] == "R":
        y += 1
    elif inst[cnt % len(inst)] == "U":
        x -= 1
    else:
        y -= 1
    X -= 1
    cnt += 1
        
print (-1)  
0