結果

問題 No.2790 Athena 3
ユーザー rin204rin204
提出日時 2024-06-22 00:47:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 793 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,288 KB
実行使用メモリ 54,004 KB
最終ジャッジ日時 2024-06-22 00:47:08
合計ジャッジ時間 1,626 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,924 KB
testcase_01 AC 36 ms
52,200 KB
testcase_02 AC 36 ms
52,508 KB
testcase_03 AC 37 ms
52,008 KB
testcase_04 AC 37 ms
52,800 KB
testcase_05 AC 36 ms
53,008 KB
testcase_06 AC 37 ms
53,352 KB
testcase_07 AC 37 ms
52,604 KB
testcase_08 AC 36 ms
51,992 KB
testcase_09 AC 36 ms
53,016 KB
testcase_10 AC 37 ms
54,004 KB
testcase_11 AC 37 ms
53,132 KB
testcase_12 AC 36 ms
53,072 KB
testcase_13 AC 37 ms
53,812 KB
testcase_14 AC 37 ms
53,068 KB
testcase_15 AC 37 ms
53,344 KB
testcase_16 AC 37 ms
53,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def area(XY):
    dx1 = XY[1][0] - XY[0][0]
    dy1 = XY[1][1] - XY[0][1]
    dx2 = XY[2][0] - XY[0][0]
    dy2 = XY[2][1] - XY[0][1]
    return abs(dx1 * dy2 - dx2 * dy1) / 2


x1, y1, x2, y2, x3, y3 = map(int, input().split())
XY = [[x1, y1], [x2, y2], [x3, y3]]
ans = 0

add = [(0, 1), (0, -1), (1, 0), (-1, 0)]
for i in range(4):
    XY[0][0] += add[i][0]
    XY[0][1] += add[i][1]
    for j in range(4):
        XY[1][0] += add[j][0]
        XY[1][1] += add[j][1]
        for k in range(4):
            XY[2][0] += add[k][0]
            XY[2][1] += add[k][1]
            ans = max(ans, area(XY))
            XY[2][0] -= add[k][0]
            XY[2][1] -= add[k][1]
        XY[1][0] -= add[j][0]
        XY[1][1] -= add[j][1]
    XY[0][0] -= add[i][0]
    XY[0][1] -= add[i][1]

print(ans)
0