結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-05-26 21:55:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 526 bytes |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-10-13 03:02:31 |
| 合計ジャッジ時間 | 4,096 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
import sys
input=lambda: sys.stdin.readline().rstrip()
h,w=map(int,input().split())
S=[input() for _ in range(h)]
St=[]
for i in range(h):
for j in range(w):
if S[i][j]=="*":
St.append((i,j))
h1,w1=St[0]
h2,w2=St[1]
Ans=[]
for i in range(h):
for j in range(w):
if (i,j)!=(h1,w1) and (i,j)!=(h2,w2) and (i-h1)*(w2-w1)!=(j-w1)*(h2-h1):
Ans.append((i,j))
break
else:
continue
break
else:
continue
break
h0,w0=Ans[0]
S[h0]=S[h0][:w0]+"*"+S[h0][w0+1:]
for s in S:
print(s)
takakin