結果

問題 No.2331 Maximum Quadrilateral
ユーザー mkawa2mkawa2
提出日時 2023-05-29 14:30:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,085 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 86,600 KB
実行使用メモリ 76,192 KB
最終ジャッジ日時 2023-08-27 23:41:53
合計ジャッジ時間 11,283 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 356 ms
76,140 KB
testcase_01 AC 246 ms
75,804 KB
testcase_02 AC 404 ms
75,880 KB
testcase_03 AC 279 ms
75,880 KB
testcase_04 AC 330 ms
75,792 KB
testcase_05 AC 346 ms
75,808 KB
testcase_06 AC 339 ms
75,836 KB
testcase_07 AC 307 ms
75,820 KB
testcase_08 AC 242 ms
76,132 KB
testcase_09 AC 230 ms
75,960 KB
testcase_10 AC 215 ms
76,116 KB
testcase_11 AC 228 ms
76,024 KB
testcase_12 AC 216 ms
75,820 KB
testcase_13 AC 224 ms
75,840 KB
testcase_14 AC 362 ms
75,864 KB
testcase_15 AC 100 ms
75,784 KB
testcase_16 AC 179 ms
76,000 KB
testcase_17 AC 85 ms
75,980 KB
testcase_18 AC 107 ms
75,924 KB
testcase_19 AC 86 ms
75,672 KB
testcase_20 AC 385 ms
75,832 KB
testcase_21 AC 390 ms
75,864 KB
testcase_22 AC 385 ms
75,916 KB
testcase_23 AC 386 ms
76,088 KB
testcase_24 AC 382 ms
76,192 KB
testcase_25 AC 70 ms
71,268 KB
testcase_26 AC 69 ms
71,192 KB
testcase_27 AC 70 ms
70,968 KB
testcase_28 AC 69 ms
71,100 KB
testcase_29 AC 69 ms
71,044 KB
testcase_30 WA -
testcase_31 AC 71 ms
70,964 KB
testcase_32 AC 70 ms
71,124 KB
testcase_33 AC 70 ms
71,280 KB
testcase_34 AC 69 ms
70,968 KB
testcase_35 AC 69 ms
71,212 KB
testcase_36 AC 68 ms
71,020 KB
testcase_37 AC 69 ms
71,228 KB
testcase_38 AC 69 ms
71,320 KB
testcase_39 AC 67 ms
71,188 KB
testcase_40 AC 68 ms
70,952 KB
testcase_41 AC 68 ms
70,952 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 69 ms
71,208 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# md = 10**9+7
md = 998244353

def outer(s,t,p,q,x,y):
    a=p-s
    b=q-t
    c=x-s
    d=y-t
    return a*d-b*c

n=II()
xy=LLI(n)

ans=0
for i,(s,t) in enumerate(xy):
    for p,q in xy[:i]:
        mn,mx=inf,-inf
        for x,y in xy:
            cur=outer(s,t,p,q,x,y)
            if cur<mn:mn=cur
            if cur>mx:mx=cur
        if mx-mn>ans:ans=mx-mn

print(ans)
0