結果

問題 No.1792 科学の甲子園
ユーザー 👑 KazunKazun
提出日時 2021-12-24 04:05:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 4,000 ms
コード長 460 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 74,496 KB
最終ジャッジ日時 2024-05-05 01:31:58
合計ジャッジ時間 2,678 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
63,104 KB
testcase_01 AC 59 ms
64,000 KB
testcase_02 AC 48 ms
61,696 KB
testcase_03 AC 50 ms
62,592 KB
testcase_04 AC 50 ms
63,104 KB
testcase_05 AC 49 ms
62,592 KB
testcase_06 AC 48 ms
62,080 KB
testcase_07 AC 46 ms
61,696 KB
testcase_08 AC 50 ms
63,488 KB
testcase_09 AC 52 ms
64,000 KB
testcase_10 AC 51 ms
63,232 KB
testcase_11 AC 70 ms
73,216 KB
testcase_12 AC 69 ms
70,912 KB
testcase_13 AC 69 ms
72,704 KB
testcase_14 AC 72 ms
74,496 KB
testcase_15 AC 67 ms
71,424 KB
testcase_16 AC 47 ms
62,336 KB
testcase_17 AC 50 ms
63,232 KB
testcase_18 AC 50 ms
62,976 KB
testcase_19 AC 67 ms
71,424 KB
testcase_20 AC 71 ms
73,984 KB
testcase_21 AC 66 ms
71,040 KB
testcase_22 AC 72 ms
72,448 KB
testcase_23 AC 78 ms
70,784 KB
testcase_24 AC 51 ms
61,696 KB
testcase_25 AC 53 ms
62,208 KB
testcase_26 AC 53 ms
62,080 KB
testcase_27 AC 70 ms
71,936 KB
testcase_28 AC 73 ms
73,984 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