結果

問題 No.455 冬の大三角
コンテスト
ユーザー niyarin
提出日時 2016-12-06 18:41:12
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 934 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 161 ms
コンパイル使用メモリ 77,564 KB
最終ジャッジ日時 2025-12-03 22:53:00
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

H,W = map(int,raw_input().split(" "))

field = []
stars = []
for h in range(H):
    line = raw_input()
    field.append(line)
    for w in range(len(line)):
        if line[w] == "*":
            stars.append((w,h))

def nyrn():
    global line
    for i in range(W):
        for j in range(H):
            
            
            s1 = stars[0]
            s2 = stars[1]
            if (s1 == (i,j)) or (s2 == (i,j)):
                continue

            if s1[0] == s2[0] == i:
                continue
            if s1[1] == s2[1] == j:
                continue


            if s1[1]-j and s2[1]-j:
                a = float(s1[0]-i)/float(s1[1]-j)
                b = float(s2[0]-i)/float(s2[1]-j)
                if a == b:
                    continue
            v = list(field[j])
            v[i] = "*"
            field[j] = "".join(v)
            return i,j
nyrn()
for line in field:
    print line




            



0