結果
問題 | No.2790 Athena 3 |
ユーザー |
|
提出日時 | 2024-06-21 21:27:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 970 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,420 KB |
実行使用メモリ | 54,152 KB |
最終ジャッジ日時 | 2024-06-21 21:27:08 |
合計ジャッジ時間 | 1,542 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
from sys import stdin def input(): return stdin.readline()[:-1] def solve(): x1, y1, x2, y2, x3, y3 = map(int, input().split()) coooor = [[x1, y1], [x2, y2], [x3, y3]] ans = 0 def dfs(index, coords): if index == 3: x1, y1 = coords[0] x2, y2 = coords[1] x3, y3 = coords[2] nonlocal ans ans = max(ans, abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2))/2)) return x, y = coooor[index] tuple1 = (x + 1, y) tuple2 = (x - 1, y) tuple3 = (x, y + 1) tuple4 = (x, y - 1) coords.append(tuple1) dfs(index + 1, coords) coords.pop() coords.append(tuple2) dfs(index + 1, coords) coords.pop() coords.append(tuple3) dfs(index + 1, coords) coords.pop() coords.append(tuple4) dfs(index + 1, coords) coords.pop() dfs(0, []) print(ans) solve()