結果

問題 No.3723 Climb or Detour
コンテスト
ユーザー kidodesu
提出日時 2026-09-19 13:08:57
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 713 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 107 ms
コンパイル使用メモリ 81,024 KB
実行使用メモリ 77,184 KB
最終ジャッジ日時 2026-09-19 13:16:24
合計ジャッジ時間 6,051 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 39 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    n, k = list(map(int, input().split()))
    sy, sx = list(map(lambda x: int(x)-1, input().split()))
    ty, tx = list(map(lambda x: int(x)-1, input().split()))
    if k % 2: return [[]]
    Ans = [["." for _ in range(n)] for _ in range(n)]
    if sx > tx:
        sy, sx, ty, tx = ty, tx, sy, sx
    l = abs(sy-ty)+abs(sx-tx)
    r = l+l//2*2
    if l <= k <= r:
        s = (k-l)//2
        for y in range(n):
            for x in range(n):
                t = abs(sy-y)+abs(sx-x)
                if t % 2 and t//2 < s:
                    Ans[y][x] = "#"
        return Ans
    else:
        return [[]]

Ans = main()
if Ans[0]:
    for ans in Ans:
        print("".join(ans))
else:
    print(-1)
0