結果

問題 No.1792 科学の甲子園
ユーザー chineristACchineristAC
提出日時 2021-12-21 00:15:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 860 bytes
コンパイル時間 1,645 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 81,804 KB
最終ジャッジ日時 2023-10-13 19:42:47
合計ジャッジ時間 7,027 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
79,572 KB
testcase_01 AC 125 ms
79,788 KB
testcase_02 WA -
testcase_03 AC 113 ms
79,184 KB
testcase_04 AC 115 ms
79,600 KB
testcase_05 AC 114 ms
78,928 KB
testcase_06 AC 112 ms
79,112 KB
testcase_07 WA -
testcase_08 AC 122 ms
80,160 KB
testcase_09 AC 127 ms
80,076 KB
testcase_10 AC 124 ms
79,664 KB
testcase_11 AC 168 ms
81,548 KB
testcase_12 AC 144 ms
81,804 KB
testcase_13 AC 152 ms
81,476 KB
testcase_14 AC 160 ms
81,716 KB
testcase_15 AC 145 ms
81,684 KB
testcase_16 AC 118 ms
79,336 KB
testcase_17 AC 116 ms
79,324 KB
testcase_18 AC 119 ms
79,372 KB
testcase_19 AC 152 ms
81,760 KB
testcase_20 AC 169 ms
81,688 KB
testcase_21 AC 163 ms
81,684 KB
testcase_22 AC 156 ms
81,412 KB
testcase_23 AC 152 ms
81,336 KB
testcase_24 AC 111 ms
79,080 KB
testcase_25 AC 122 ms
79,324 KB
testcase_26 AC 120 ms
79,256 KB
testcase_27 AC 156 ms
81,716 KB
testcase_28 AC 161 ms
81,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N = int(input())
dp = [[0 for j in range(5)] for i in range(1<<6)]
dp[0][0] = 1
for i in range(N):
    A = li()
    P = [0 for S in range(1<<6)]
    P[0] = 1
    for j in range(6):
        for S in range(1<<j,2<<j):
            P[S] = P[S-(1<<j)] * A[j]
    
    for S in range(1<<6)[::-1]:
        for j in range(4)[::-1]:
            T = (1<<6) -1- S
            if not dp[S][j]:
                continue
            tmp = T
            while tmp:
                dp[S+tmp][j+1] = max(dp[S+tmp][j+1],dp[S][j]*P[tmp])
                tmp = (tmp-1)&T
    
    #print(dp)

print(dp[-1][4])
0