結果

問題 No.2790 Athena 3
コンテスト
ユーザー dp_ijk
提出日時 2024-06-21 21:30:00
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 64 ms / 2,000 ms
+ 414µs
コード長 536 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 242 ms
コンパイル使用メモリ 95,468 KB
実行使用メモリ 78,976 KB
最終ジャッジ日時 2026-07-26 14:54:42
合計ジャッジ時間 2,673 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

x1, y1, x2, y2, x3, y3 = map(int, input().split())
P1, P2, P3 = (x1, y1), (x2, y2), (x3, y3)


def adj(P):
   x, y = P
   res = []
   for dx in -1, 0, 1:
      for dy in -1, 0, 1:
         if dx*dy == 0 and dx+dy != 0:
            res.append((x+dx, y+dy))
   return res


def area(P, Q, R):
   x, y = P
   a, b = Q
   c, d = R
   a, b = a-x, b-y
   c, d = c-x, d-y
   return abs(a*d - b*c)


cands = []
for P in adj(P1):
   for Q in adj(P2):
      for R in adj(P3):
         cands.append(area(P, Q, R))

ans = max(cands) / 2
print(ans)
0