結果

問題 No.1792 科学の甲子園
ユーザー とりゐとりゐ
提出日時 2021-12-21 13:52:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 4,000 ms
コード長 2,568 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 72,448 KB
最終ジャッジ日時 2024-11-26 17:55:37
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

x=[((0,), (1,), (2,), (3, 4, 5)),((0,), (1,), (2, 3), (4, 5)),((0,), (1,), (2, 3, 4), (5,)),((0,), (1,), (2, 3, 5), (4,)),((0,), (1,), (2, 4), (3, 5)),((0,), (1,), (2, 4, 5), (3,)),((0,), (1,), (2, 5), (3, 4)),((0,), (1, 2), (3,), (4, 5)),((0,), (1, 2), (3, 4), (5,)),((0,), (1, 2), (3, 5), (4,)),((0,), (1, 2, 3), (4,), (5,)),((0,), (1, 2, 4), (3,), (5,)),((0,), (1, 2, 5), (3,), (4,)),((0,), (1, 3), (2,), (4, 5)),((0,), (1, 3), (2, 4), (5,)),((0,), (1, 3), (2, 5), (4,)),((0,), (1, 3, 4), (2,), (5,)),((0,), (1, 3, 5), (2,), (4,)),((0,), (1, 4), (2,), (3, 5)),((0,), (1, 4), (2, 3), (5,)),((0,), (1, 4), (2, 5), (3,)),((0,), (1, 4, 5), (2,), (3,)),((0,), (1, 5), (2,), (3, 4)),((0,), (1, 5), (2, 3), (4,)),((0,), (1, 5), (2, 4), (3,)),((0, 1), (2,), (3,), (4, 5)),((0, 1), (2,), (3, 4), (5,)),((0, 1), (2,), (3, 5), (4,)),((0, 1), (2, 3), (4,), (5,)),((0, 1), (2, 4), (3,), (5,)),((0, 1), (2, 5), (3,), (4,)),((0, 1, 2), (3,), (4,), (5,)),((0, 1, 3), (2,), (4,), (5,)),((0, 1, 4), (2,), (3,), (5,)),((0, 1, 5), (2,), (3,), (4,)),((0, 2), (1,), (3,), (4, 5)),((0, 2), (1,), (3, 4), (5,)),((0, 2), (1,), (3, 5), (4,)),((0, 2), (1, 3), (4,), (5,)),((0, 2), (1, 4), (3,), (5,)),((0, 2), (1, 5), (3,), (4,)),((0, 2, 3), (1,), (4,), (5,)),((0, 2, 4), (1,), (3,), (5,)),((0, 2, 5), (1,), (3,), (4,)),((0, 3), (1,), (2,), (4, 5)),((0, 3), (1,), (2, 4), (5,)),((0, 3), (1,), (2, 5), (4,)),((0, 3), (1, 2), (4,), (5,)),((0, 3), (1, 4), (2,), (5,)),((0, 3), (1, 5), (2,), (4,)),((0, 3, 4), (1,), (2,), (5,)),((0, 3, 5), (1,), (2,), (4,)),((0, 4), (1,), (2,), (3, 5)),((0, 4), (1,), (2, 3), (5,)),((0, 4), (1,), (2, 5), (3,)),((0, 4), (1, 2), (3,), (5,)),((0, 4), (1, 3), (2,), (5,)),((0, 4), (1, 5), (2,), (3,)),((0, 4, 5), (1,), (2,), (3,)),((0, 5), (1,), (2,), (3, 4)),((0, 5), (1,), (2, 3), (4,)),((0, 5), (1,), (2, 4), (3,)),((0, 5), (1, 2), (3,), (4,)),((0, 5), (1, 3), (2,), (4,)),((0, 5), (1, 4), (2,), (3,))]
y=[(0,), (0, 1), (0, 1, 2), (0, 1, 3), (0, 1, 4), (0, 1, 5), (0, 2), (0, 2, 3), (0, 2, 4), (0, 2, 5), (0, 3), (0, 3, 4), (0, 3, 5), (0, 4), (0, 4, 5), (0, 5), (1,), (1, 2), (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3), (1, 3, 4), (1, 3, 5), (1, 4), (1, 4, 5), (1, 5), (2,), (2, 3), (2, 3, 4), (2, 3, 5), (2, 4), (2, 4, 5), (2, 5), (3,), (3, 4), (3, 4, 5), (3, 5), (4,), (4, 5), (5,)]

n=int(input())
a=[0]*n
for i in range(n):
  a[i]=list(map(int,input().split()))

d={}
for s in y:
  mx=0
  for i in range(n):
    tmp=1
    for j in s:
      tmp*=a[i][j]
    mx=max(mx,tmp)
  d[s]=mx

ans=0
for s1,s2,s3,s4 in x:
  ans=max(ans,d[s1]*d[s2]*d[s3]*d[s4])

print(ans)
0