結果

問題 No.455 冬の大三角
ユーザー 👑 yumechiyumechi
提出日時 2016-12-07 17:28:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,096 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 53,120 KB
最終ジャッジ日時 2024-05-06 01:33:33
合計ジャッジ時間 5,249 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
51,968 KB
testcase_01 AC 51 ms
52,096 KB
testcase_02 AC 50 ms
52,224 KB
testcase_03 AC 50 ms
51,968 KB
testcase_04 AC 51 ms
52,096 KB
testcase_05 WA -
testcase_06 AC 51 ms
52,224 KB
testcase_07 AC 50 ms
52,096 KB
testcase_08 AC 52 ms
52,608 KB
testcase_09 AC 51 ms
51,712 KB
testcase_10 AC 48 ms
52,096 KB
testcase_11 AC 43 ms
51,712 KB
testcase_12 AC 42 ms
52,096 KB
testcase_13 AC 43 ms
52,096 KB
testcase_14 AC 44 ms
51,968 KB
testcase_15 AC 44 ms
51,968 KB
testcase_16 AC 43 ms
51,840 KB
testcase_17 AC 42 ms
52,096 KB
testcase_18 AC 43 ms
51,712 KB
testcase_19 AC 43 ms
52,352 KB
testcase_20 AC 47 ms
51,840 KB
testcase_21 AC 44 ms
51,712 KB
testcase_22 AC 43 ms
52,352 KB
testcase_23 AC 42 ms
51,968 KB
testcase_24 AC 50 ms
51,712 KB
testcase_25 AC 50 ms
52,096 KB
testcase_26 AC 50 ms
51,712 KB
testcase_27 AC 50 ms
51,968 KB
testcase_28 AC 51 ms
51,712 KB
testcase_29 AC 50 ms
53,120 KB
testcase_30 AC 44 ms
52,608 KB
testcase_31 AC 44 ms
52,608 KB
testcase_32 AC 43 ms
52,224 KB
testcase_33 AC 47 ms
52,608 KB
testcase_34 AC 44 ms
52,224 KB
testcase_35 AC 44 ms
52,608 KB
testcase_36 AC 44 ms
52,224 KB
testcase_37 AC 44 ms
52,352 KB
testcase_38 AC 45 ms
52,224 KB
testcase_39 AC 45 ms
52,992 KB
testcase_40 AC 44 ms
52,224 KB
testcase_41 AC 45 ms
52,480 KB
testcase_42 AC 43 ms
52,352 KB
testcase_43 AC 42 ms
52,096 KB
testcase_44 AC 43 ms
51,968 KB
testcase_45 AC 43 ms
52,864 KB
testcase_46 AC 45 ms
52,352 KB
testcase_47 AC 45 ms
52,608 KB
testcase_48 AC 43 ms
52,224 KB
testcase_49 WA -
testcase_50 AC 44 ms
51,840 KB
testcase_51 AC 43 ms
52,096 KB
testcase_52 AC 44 ms
52,096 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 46 ms
52,224 KB
testcase_56 AC 45 ms
51,968 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()
        while "*" in line:
            idx = line.find("*")
            if px == -1:
                px, py = idx, y
            else:
                if len(line) == h:
                    qx, qy = idx, y
                else:
                    qx, qy = idx + px + 1, y
            line = line[idx+1:]
    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