結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-06 18:41:12 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 934 bytes |
| コンパイル時間 | 370 ms |
| コンパイル使用メモリ | 6,944 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 21:15:54 |
| 合計ジャッジ時間 | 2,967 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
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