結果

問題 No.1792 科学の甲子園
ユーザー 👑 KazunKazun
提出日時 2021-12-24 04:05:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 4,000 ms
コード長 460 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 77,672 KB
最終ジャッジ日時 2023-08-17 18:42:09
合計ジャッジ時間 4,488 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
76,532 KB
testcase_01 AC 91 ms
76,772 KB
testcase_02 AC 86 ms
76,400 KB
testcase_03 AC 88 ms
76,588 KB
testcase_04 AC 92 ms
76,468 KB
testcase_05 AC 87 ms
76,540 KB
testcase_06 AC 87 ms
76,680 KB
testcase_07 AC 85 ms
76,584 KB
testcase_08 AC 90 ms
76,544 KB
testcase_09 AC 91 ms
76,672 KB
testcase_10 AC 89 ms
76,368 KB
testcase_11 AC 109 ms
77,376 KB
testcase_12 AC 105 ms
77,036 KB
testcase_13 AC 109 ms
77,552 KB
testcase_14 AC 110 ms
77,672 KB
testcase_15 AC 104 ms
77,132 KB
testcase_16 AC 85 ms
76,480 KB
testcase_17 AC 91 ms
76,684 KB
testcase_18 AC 90 ms
76,896 KB
testcase_19 AC 104 ms
76,944 KB
testcase_20 AC 111 ms
77,548 KB
testcase_21 AC 104 ms
77,260 KB
testcase_22 AC 107 ms
77,432 KB
testcase_23 AC 102 ms
77,308 KB
testcase_24 AC 85 ms
76,456 KB
testcase_25 AC 87 ms
76,596 KB
testcase_26 AC 85 ms
76,464 KB
testcase_27 AC 104 ms
76,940 KB
testcase_28 AC 111 ms
77,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

N=int(input())

K=6
P=[0]*(2**K)

for i in range(N):
    S=list(map(int,input().split()))

    p=[1]*(2**K)
    for E in range(2**K):
        F=E
        for k in range(K):
            if E&1==1:
                p[F]*=S[k]
            E>>=1

        P[F]=max(P[F],p[F])

X=0
for A in product(range(4),repeat=K):
    B=[0,0,0,0]
    for k in range(K):
        B[A[k]]|=1<<k

    X=max(X,P[B[0]]*P[B[1]]*P[B[2]]*P[B[3]])

print(X)
0