結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
76,408 KB
testcase_01 AC 85 ms
76,556 KB
testcase_02 AC 80 ms
76,528 KB
testcase_03 AC 82 ms
76,692 KB
testcase_04 AC 89 ms
76,672 KB
testcase_05 AC 83 ms
76,708 KB
testcase_06 AC 82 ms
76,744 KB
testcase_07 AC 80 ms
76,828 KB
testcase_08 AC 86 ms
76,888 KB
testcase_09 AC 85 ms
76,820 KB
testcase_10 AC 84 ms
76,636 KB
testcase_11 AC 94 ms
77,060 KB
testcase_12 AC 92 ms
76,772 KB
testcase_13 AC 91 ms
77,108 KB
testcase_14 AC 94 ms
77,008 KB
testcase_15 AC 92 ms
76,936 KB
testcase_16 AC 82 ms
76,756 KB
testcase_17 AC 88 ms
76,888 KB
testcase_18 AC 86 ms
76,920 KB
testcase_19 AC 94 ms
76,812 KB
testcase_20 AC 96 ms
76,948 KB
testcase_21 AC 95 ms
77,092 KB
testcase_22 AC 95 ms
77,020 KB
testcase_23 AC 90 ms
76,792 KB
testcase_24 AC 80 ms
76,820 KB
testcase_25 AC 83 ms
76,648 KB
testcase_26 AC 85 ms
76,624 KB
testcase_27 AC 95 ms
76,768 KB
testcase_28 AC 97 ms
76,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import product

input=sys.stdin.readline
N=int(input())

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

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

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

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

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