結果

問題 No.2790 Athena 3
ユーザー AwashAmityOak
提出日時 2024-06-21 21:58:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 787 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,892 KB
実行使用メモリ 54,444 KB
最終ジャッジ日時 2024-09-20 14:22:18
合計ジャッジ時間 1,748 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

def heron(a, b, c):
	s = (a + b + c) / 2
	return (s * (s - a) * (s - b) * (s - c)) ** 0.5

def dist(a, b):
	return ((a[0]-b[0]) ** 2 + (a[1]-b[1]) ** 2) ** 0.5

def dists(a, b, c):
	return dist(a, b), dist(b, c), dist(c, a)

def space(a, b, c):
	return heron(*dists(a, b, c))

*data, = map(int, input().split())
points = [data[i*2:i*2+2] for i in range(3)]


dpos = [(-1, 0), (1, 0), (0, -1), (0, 1)]
ans = 0
for dax, day in dpos:
	points[0][0] += dax
	points[0][1] += day
	for dbx, dby in dpos:
		points[1][0] += dbx
		points[1][1] += dby
		for dcx, dcy in dpos:
			points[2][0] += dcx
			points[2][1] += dcy
			ans = max(ans, space(*points))
			points[2][0] -= dcx
			points[2][1] -= dcy
		points[1][0] -= dbx
		points[1][1] -= dby
	points[0][0] -= dax
	points[0][1] -= day
print(ans)
0