結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-06 08:07:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 630 bytes |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-29 21:12:12 |
| 合計ジャッジ時間 | 3,769 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
#!/usr/bin/env python3
h, w = map(int, input().split())
s = [ input() for _ in range(h) ]
stars = []
for y in range(h):
for x in range(w):
if s[y][x] == '*':
stars += [( y, x )]
assert len(stars) == 2
for y in range(h):
for x in range(w):
if len(stars) == 3:
continue
if s[y][x] == '-':
ay, ax = stars[0]
by, bx = stars[1]
if (ay - y) * (bx - x) != (ax - x) * (by - y):
s[y] = list(s[y])
s[y][x] = '*'
s[y] = ''.join(s[y])
stars += [( y, x )]
for line in s:
print(line)