結果
| 問題 | No.455 冬の大三角 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-07 17:03:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 743 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 52,736 KB |
| 最終ジャッジ日時 | 2024-11-28 03:25:00 |
| 合計ジャッジ時間 | 4,753 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 WA * 18 |
ソースコード
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 = 0, 0
if not(px == py and qx == qy):
tx, ty = px, py
tx -= 1 if px > 0 else -1
ty -= 1 if py > 0 else -1
else:
tx = px
points = [[px, qx, tx], [py, qy, ty]]
for y in range(w):
line = "-" * h
if y in points[1]:
idx = points[1].index(y)
line = line[:points[0][idx]] + "*" + line[points[0][idx]+1:]
print(line)
if __name__=="__main__":
solve()