結果

問題 No.2331 Maximum Quadrilateral
ユーザー pありpあり
提出日時 2023-05-28 15:56:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 429 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 77,520 KB
最終ジャッジ日時 2023-08-27 13:23:00
合計ジャッジ時間 10,849 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 355 ms
76,988 KB
testcase_01 AC 262 ms
77,224 KB
testcase_02 AC 429 ms
77,124 KB
testcase_03 AC 285 ms
77,064 KB
testcase_04 AC 330 ms
77,148 KB
testcase_05 AC 349 ms
77,072 KB
testcase_06 AC 340 ms
76,948 KB
testcase_07 AC 321 ms
77,084 KB
testcase_08 AC 256 ms
76,948 KB
testcase_09 AC 239 ms
77,084 KB
testcase_10 AC 232 ms
77,204 KB
testcase_11 AC 242 ms
77,276 KB
testcase_12 AC 225 ms
77,224 KB
testcase_13 AC 239 ms
77,336 KB
testcase_14 AC 375 ms
77,520 KB
testcase_15 AC 115 ms
76,460 KB
testcase_16 AC 195 ms
77,160 KB
testcase_17 AC 97 ms
76,576 KB
testcase_18 AC 122 ms
76,488 KB
testcase_19 AC 101 ms
76,400 KB
testcase_20 AC 394 ms
76,892 KB
testcase_21 AC 395 ms
76,976 KB
testcase_22 AC 389 ms
77,392 KB
testcase_23 AC 387 ms
77,000 KB
testcase_24 AC 384 ms
77,452 KB
testcase_25 AC 67 ms
71,292 KB
testcase_26 AC 66 ms
71,340 KB
testcase_27 AC 67 ms
71,516 KB
testcase_28 AC 66 ms
71,480 KB
testcase_29 AC 69 ms
71,336 KB
testcase_30 AC 67 ms
71,272 KB
testcase_31 AC 67 ms
71,148 KB
testcase_32 AC 68 ms
71,324 KB
testcase_33 AC 70 ms
71,452 KB
testcase_34 AC 68 ms
71,216 KB
testcase_35 AC 69 ms
71,436 KB
testcase_36 AC 69 ms
71,292 KB
testcase_37 AC 67 ms
71,340 KB
testcase_38 AC 68 ms
71,300 KB
testcase_39 AC 68 ms
71,296 KB
testcase_40 AC 69 ms
71,252 KB
testcase_41 AC 68 ms
71,292 KB
testcase_42 AC 66 ms
71,340 KB
testcase_43 AC 68 ms
71,096 KB
testcase_44 AC 67 ms
71,316 KB
testcase_45 AC 65 ms
71,292 KB
testcase_46 AC 67 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

xy = []

for i in range(n):
  x,y = map(int, input().split())
  xy.append((x,y))
  
  
def gaiseki(x1,y1, x2, y2, x3,y3):
  v1x = x3-x1
  v2x = x3-x2
  v1y = y3-y1
  v2y = y3-y2
  
  return v1x*v2y - v1y*v2x

M = 10**18
ans = 0
for i in range(n):
  x1,y1 = xy[i]
  for j in range(i+1, n):
    x2,y2 = xy[j]
    
    v_max = -M
    v_min = M
    
    for k in range(n):
      if(i==k or j==k):
        continue
      x3,y3 = xy[k]
      now = gaiseki(x1,y1, x2, y2, x3,y3)
      v_max = max(v_max, now)
      v_min = min(v_min, now)
    
    if(v_min>0 and v_max<0):
      continue
    ans = max(ans, v_max-v_min)

print(ans)
    
    
  
0