結果

問題 No.455 冬の大三角
ユーザー 👑 yumechiyumechi
提出日時 2016-12-07 17:24:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 948 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 71,604 KB
最終ジャッジ日時 2023-08-18 19:49:12
合計ジャッジ時間 6,939 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,180 KB
testcase_01 AC 67 ms
71,172 KB
testcase_02 AC 72 ms
71,268 KB
testcase_03 AC 68 ms
71,316 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 70 ms
71,424 KB
testcase_07 AC 69 ms
71,196 KB
testcase_08 AC 73 ms
71,164 KB
testcase_09 AC 70 ms
71,468 KB
testcase_10 AC 72 ms
71,468 KB
testcase_11 AC 70 ms
71,496 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 69 ms
71,200 KB
testcase_15 AC 68 ms
71,192 KB
testcase_16 AC 66 ms
71,368 KB
testcase_17 AC 68 ms
71,240 KB
testcase_18 AC 69 ms
71,184 KB
testcase_19 WA -
testcase_20 AC 68 ms
71,428 KB
testcase_21 AC 71 ms
71,260 KB
testcase_22 WA -
testcase_23 AC 68 ms
71,096 KB
testcase_24 WA -
testcase_25 AC 68 ms
71,212 KB
testcase_26 AC 71 ms
71,236 KB
testcase_27 AC 74 ms
71,152 KB
testcase_28 AC 67 ms
71,240 KB
testcase_29 AC 68 ms
71,300 KB
testcase_30 AC 70 ms
71,200 KB
testcase_31 AC 67 ms
71,576 KB
testcase_32 AC 65 ms
71,312 KB
testcase_33 AC 69 ms
71,096 KB
testcase_34 AC 67 ms
71,212 KB
testcase_35 AC 67 ms
71,072 KB
testcase_36 AC 68 ms
71,264 KB
testcase_37 AC 67 ms
71,072 KB
testcase_38 AC 67 ms
71,544 KB
testcase_39 AC 70 ms
71,236 KB
testcase_40 AC 67 ms
71,468 KB
testcase_41 AC 70 ms
71,372 KB
testcase_42 AC 68 ms
71,348 KB
testcase_43 AC 69 ms
71,340 KB
testcase_44 AC 68 ms
71,332 KB
testcase_45 AC 70 ms
71,368 KB
testcase_46 AC 72 ms
71,484 KB
testcase_47 AC 69 ms
71,320 KB
testcase_48 AC 73 ms
71,268 KB
testcase_49 WA -
testcase_50 AC 70 ms
71,532 KB
testcase_51 AC 68 ms
71,196 KB
testcase_52 AC 69 ms
71,196 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 69 ms
71,392 KB
testcase_56 AC 67 ms
71,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    w, h = map(int, input().split())
    px, py, qx, qy = -1, -1, -1, -1
    for y in range(w):
        line = input()
        idx = line.find("*")
        if idx >= 0:
            if px == -1:
                px, py = idx, y
            else:
                qx, qy = idx, y
    tx, ty = -1, -1
    patternlist = [[px-1, px+1, qx-1, qx+1], [py-1, py+1, qy-1, qy+1]]
    for j in range(4):
        for k in range(4):
            x, y = patternlist[0][j], patternlist[1][k]
            if (0 <= x < h and 0 <= y < w) \
                and (not(x == px and y == py)) and (not(x == qx and y == qy)):
                tx, ty = x, y
                break
        if tx != -1:
            break

    points = [[px, qx, tx], [py, qy, ty]]
    ans = [list("-" * h) for _ in range(w)]
    for i in range(3):
        ans[points[1][i]][points[0][i]] = "*"
    print("\n".join(["".join(line) for line in ans]))

if __name__=="__main__":
    solve()
0