結果
問題 | No.2790 Athena 3 |
ユーザー |
![]() |
提出日時 | 2024-06-21 21:58:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 787 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 82,564 KB |
実行使用メモリ | 54,200 KB |
最終ジャッジ日時 | 2024-06-21 21:58:38 |
合計ジャッジ時間 | 2,066 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 34 ms
53,596 KB |
testcase_01 | AC | 33 ms
53,332 KB |
testcase_02 | AC | 33 ms
54,200 KB |
testcase_03 | AC | 33 ms
53,220 KB |
testcase_04 | AC | 32 ms
53,084 KB |
testcase_05 | AC | 34 ms
53,832 KB |
testcase_06 | AC | 33 ms
53,048 KB |
testcase_07 | AC | 34 ms
52,780 KB |
testcase_08 | AC | 32 ms
53,420 KB |
testcase_09 | AC | 34 ms
53,336 KB |
testcase_10 | AC | 33 ms
54,192 KB |
testcase_11 | AC | 35 ms
53,204 KB |
testcase_12 | AC | 32 ms
53,152 KB |
testcase_13 | AC | 34 ms
52,840 KB |
testcase_14 | AC | 52 ms
53,828 KB |
testcase_15 | AC | 33 ms
53,744 KB |
testcase_16 | AC | 38 ms
53,152 KB |
ソースコード
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)