結果

問題 No.2790 Athena 3
ユーザー aa
提出日時 2024-06-21 22:28:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 598 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 52,992 KB
最終ジャッジ日時 2024-06-30 16:37:39
合計ジャッジ時間 1,795 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,352 KB
testcase_01 AC 38 ms
52,480 KB
testcase_02 AC 39 ms
52,352 KB
testcase_03 AC 41 ms
52,352 KB
testcase_04 AC 38 ms
52,608 KB
testcase_05 AC 38 ms
52,608 KB
testcase_06 AC 38 ms
52,608 KB
testcase_07 AC 38 ms
52,608 KB
testcase_08 AC 39 ms
52,352 KB
testcase_09 AC 38 ms
52,652 KB
testcase_10 AC 38 ms
52,480 KB
testcase_11 AC 38 ms
52,352 KB
testcase_12 AC 39 ms
52,656 KB
testcase_13 AC 38 ms
52,608 KB
testcase_14 AC 38 ms
52,224 KB
testcase_15 AC 39 ms
52,352 KB
testcase_16 AC 38 ms
52,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def distance(x1, y1, x2, y2):
    return ((x2 - x1)**2 + (y2 - y1)**2)**0.5
def heron_area(x1, y1, x2, y2, x3, y3):
    a = distance(x1, y1, x2, y2)
    b = distance(x2, y2, x3, y3)
    c = distance(x3, y3, x1, y1)
    s = (a + b + c) / 2
    area = (s * (s - a) * (s - b) * (s - c))**0.5
    return area
x1,y1,x2,y2,x3,y3=map(int,input().split())
a=[[1,0],[-1,0],[0,1],[0,-1]]
b=[[x1,y1],[x2,y2],[x3,y3]]
c=0
for i in range(4):
	for j in range(4):
		for k in range(4):
			c=max(c,heron_area(b[0][0]+a[i][0],b[0][1]+a[i][1],b[1][0]+a[j][0],b[1][1]+a[j][1],b[2][0]+a[k][0],b[2][1]+a[k][1]))
print(c)
0