結果

問題 No.2790 Athena 3
ユーザー いまり💣🍠いまり💣🍠
提出日時 2024-06-21 21:38:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 53,848 KB
最終ジャッジ日時 2024-06-21 21:38:47
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,344 KB
testcase_01 AC 34 ms
53,488 KB
testcase_02 AC 35 ms
52,556 KB
testcase_03 AC 34 ms
52,552 KB
testcase_04 AC 35 ms
52,824 KB
testcase_05 AC 35 ms
52,276 KB
testcase_06 AC 38 ms
52,140 KB
testcase_07 AC 34 ms
52,364 KB
testcase_08 AC 35 ms
53,848 KB
testcase_09 AC 35 ms
53,380 KB
testcase_10 AC 34 ms
52,336 KB
testcase_11 AC 35 ms
52,400 KB
testcase_12 AC 34 ms
53,096 KB
testcase_13 AC 33 ms
52,364 KB
testcase_14 AC 35 ms
52,284 KB
testcase_15 AC 35 ms
52,824 KB
testcase_16 AC 36 ms
52,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def calc_area(x1, y1, x2, y2, x3, y3):
    return abs((x1 - x3) * (y2 - y3) - (x2 - x3) * (y1 - y3)) / 2

directions = (-1, 0), (1, 0), (0, -1), (0, 1)
max_area = 0
for dx1, dy1 in directions:
    nx1 = x1 + dx1
    ny1 = y1 + dy1
    for dx2, dy2 in directions:
        nx2 = x2 + dx2
        ny2 = y2 + dy2
        for dx3, dy3 in directions:
            nx3 = x3 + dx3
            ny3 = y3 + dy3
            max_area = max(max_area, calc_area(nx1, ny1, nx2, ny2, nx3, ny3))

print(max_area)
0