結果

問題 No.2331 Maximum Quadrilateral
ユーザー rlangevinrlangevin
提出日時 2023-10-12 12:44:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 648 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 76,720 KB
最終ジャッジ日時 2023-10-12 12:44:49
合計ジャッジ時間 14,607 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 552 ms
76,280 KB
testcase_01 AC 372 ms
76,544 KB
testcase_02 AC 430 ms
76,604 KB
testcase_03 AC 530 ms
76,620 KB
testcase_04 AC 529 ms
76,408 KB
testcase_05 AC 568 ms
76,520 KB
testcase_06 AC 504 ms
76,524 KB
testcase_07 AC 473 ms
76,604 KB
testcase_08 AC 344 ms
76,556 KB
testcase_09 AC 327 ms
76,468 KB
testcase_10 AC 328 ms
76,208 KB
testcase_11 AC 338 ms
76,720 KB
testcase_12 AC 319 ms
76,400 KB
testcase_13 AC 347 ms
76,504 KB
testcase_14 AC 574 ms
76,504 KB
testcase_15 AC 123 ms
76,544 KB
testcase_16 AC 253 ms
76,536 KB
testcase_17 AC 95 ms
76,492 KB
testcase_18 AC 137 ms
76,200 KB
testcase_19 AC 98 ms
76,500 KB
testcase_20 AC 619 ms
76,492 KB
testcase_21 AC 648 ms
76,612 KB
testcase_22 AC 583 ms
76,436 KB
testcase_23 AC 647 ms
76,548 KB
testcase_24 AC 620 ms
76,548 KB
testcase_25 AC 72 ms
71,580 KB
testcase_26 AC 73 ms
71,388 KB
testcase_27 AC 72 ms
71,404 KB
testcase_28 AC 71 ms
71,116 KB
testcase_29 AC 71 ms
71,124 KB
testcase_30 AC 72 ms
71,260 KB
testcase_31 AC 71 ms
71,324 KB
testcase_32 AC 71 ms
71,584 KB
testcase_33 AC 72 ms
71,516 KB
testcase_34 AC 71 ms
71,576 KB
testcase_35 AC 71 ms
71,324 KB
testcase_36 AC 71 ms
71,296 KB
testcase_37 AC 72 ms
71,640 KB
testcase_38 AC 72 ms
71,476 KB
testcase_39 AC 71 ms
71,116 KB
testcase_40 AC 72 ms
71,156 KB
testcase_41 AC 70 ms
71,456 KB
testcase_42 AC 71 ms
71,184 KB
testcase_43 AC 69 ms
71,360 KB
testcase_44 AC 69 ms
71,412 KB
testcase_45 AC 71 ms
71,316 KB
testcase_46 AC 70 ms
71,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
X, Y = [0] * N, [0] * N
for i in range(N):
    X[i], Y[i] = map(int, input().split())

def f(x1, x2, y1, y2, x, y):
    return (x2 - x1) * (y - y1) - (y2 - y1) * (x - x1)

ans = 0
inf = 10 ** 18
for i in range(N):
    for j in range(i + 1, N):
        ans1, ans2 = -inf, -inf
        for k in range(N):
            v = f(X[i], X[j], Y[i], Y[j], X[k], Y[k])
            if v == 0:
                continue
            if v > 0:
                ans1 = max(ans1, v)
            else:
                ans2 = max(ans2, -v)
        ans = max(ans, ans1 + ans2)

print(ans)
0