結果

問題 No.1792 科学の甲子園
ユーザー とりゐとりゐ
提出日時 2021-12-21 13:39:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 4,000 ms
コード長 2,447 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 78,540 KB
最終ジャッジ日時 2023-08-17 18:41:47
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,196 KB
testcase_01 AC 84 ms
75,836 KB
testcase_02 AC 76 ms
71,480 KB
testcase_03 AC 75 ms
71,484 KB
testcase_04 AC 76 ms
71,132 KB
testcase_05 AC 76 ms
71,372 KB
testcase_06 AC 75 ms
71,172 KB
testcase_07 AC 75 ms
71,132 KB
testcase_08 AC 102 ms
76,792 KB
testcase_09 AC 116 ms
77,268 KB
testcase_10 AC 82 ms
75,852 KB
testcase_11 AC 143 ms
78,192 KB
testcase_12 AC 136 ms
77,516 KB
testcase_13 AC 146 ms
78,088 KB
testcase_14 AC 149 ms
78,368 KB
testcase_15 AC 136 ms
77,788 KB
testcase_16 AC 76 ms
71,520 KB
testcase_17 AC 83 ms
76,008 KB
testcase_18 AC 82 ms
75,908 KB
testcase_19 AC 136 ms
77,524 KB
testcase_20 AC 153 ms
78,292 KB
testcase_21 AC 138 ms
77,800 KB
testcase_22 AC 151 ms
78,460 KB
testcase_23 AC 143 ms
78,020 KB
testcase_24 AC 78 ms
71,484 KB
testcase_25 AC 79 ms
71,232 KB
testcase_26 AC 78 ms
71,228 KB
testcase_27 AC 140 ms
77,532 KB
testcase_28 AC 152 ms
78,540 KB
権限があれば一括ダウンロードができます

ソースコード

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,))]

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

ans=0
for s1,s2,s3,s4 in x:
  mx1,mx2,mx3,mx4=0,0,0,0
  for i in range(n):

    tmp1=1
    for j in s1:
      tmp1*=a[i][j]
    mx1=max(tmp1,mx1)

    tmp2=1
    for j in s2:
      tmp2*=a[i][j]
    mx2=max(tmp2,mx2)

    tmp3=1
    for j in s3:
      tmp3*=a[i][j]
    mx3=max(tmp3,mx3)

    tmp4=1
    for j in s4:
      tmp4*=a[i][j]
    mx4=max(tmp4,mx4)

  ans=max(ans,mx1*mx2*mx3*mx4)
  #print(s1,mx1,s2,mx2,s3,mx3,s4,mx4,mx1*mx2*mx3*mx4)

print(ans)
0