結果
| 問題 |
No.2790 Athena 3
|
| コンテスト | |
| ユーザー |
hibit_at
|
| 提出日時 | 2024-06-21 21:25:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 783 bytes |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-21 21:25:17 |
| 合計ジャッジ時間 | 1,357 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
import itertools
def triangle_area(A, B, C):
x1, y1 = A
x2, y2 = B
x3, y3 = C
return abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)) / 2)
def max_triangle_area(A, B, C):
max_area = 0
operations = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for op_A in operations:
new_A = (A[0] + op_A[0], A[1] + op_A[1])
for op_B in operations:
new_B = (B[0] + op_B[0], B[1] + op_B[1])
for op_C in operations:
new_C = (C[0] + op_C[0], C[1] + op_C[1])
area = triangle_area(new_A, new_B, new_C)
if area > max_area:
max_area = area
return max_area
a,aa,b,bb,c,cc = list(map(int, input().split(' ')))
A = (a,aa)
B = (b,bb)
C = (c,cc)
print(max_triangle_area(A, B, C))
hibit_at