結果

問題 No.2071 Shift and OR
ユーザー titiatitia
提出日時 2022-09-17 01:01:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 590 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 104,492 KB
最終ジャッジ日時 2023-08-23 17:18:59
合計ジャッジ時間 6,593 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
70,936 KB
testcase_01 AC 81 ms
76,436 KB
testcase_02 AC 79 ms
76,396 KB
testcase_03 AC 84 ms
76,012 KB
testcase_04 WA -
testcase_05 AC 106 ms
76,736 KB
testcase_06 AC 85 ms
76,456 KB
testcase_07 AC 80 ms
76,412 KB
testcase_08 AC 81 ms
76,088 KB
testcase_09 AC 85 ms
76,172 KB
testcase_10 AC 84 ms
76,260 KB
testcase_11 AC 109 ms
76,528 KB
testcase_12 AC 106 ms
76,660 KB
testcase_13 AC 103 ms
77,084 KB
testcase_14 AC 70 ms
71,116 KB
testcase_15 AC 93 ms
76,200 KB
testcase_16 AC 89 ms
76,448 KB
testcase_17 AC 112 ms
76,984 KB
testcase_18 AC 76 ms
76,412 KB
testcase_19 AC 122 ms
76,512 KB
testcase_20 AC 126 ms
76,724 KB
testcase_21 AC 413 ms
76,920 KB
testcase_22 AC 165 ms
76,744 KB
testcase_23 AC 105 ms
101,156 KB
testcase_24 AC 74 ms
76,008 KB
testcase_25 AC 86 ms
86,908 KB
testcase_26 AC 88 ms
88,520 KB
testcase_27 AC 74 ms
75,340 KB
testcase_28 AC 108 ms
104,492 KB
testcase_29 AC 109 ms
104,464 KB
testcase_30 AC 85 ms
76,004 KB
testcase_31 AC 87 ms
76,312 KB
testcase_32 AC 85 ms
76,104 KB
testcase_33 AC 85 ms
76,116 KB
testcase_34 AC 84 ms
76,232 KB
testcase_35 AC 83 ms
76,188 KB
testcase_36 AC 83 ms
76,196 KB
testcase_37 AC 85 ms
76,156 KB
testcase_38 AC 86 ms
76,160 KB
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

if N>=16:
    print(2**16-1)
    exit()

DP=[0]*(1<<N)

for i in range(1<<N):
    now=DP[i]
    for j in range(N):
        if i & (1<<j) != 0:
            continue

        k=A[j]
        while k%2==0:
            k//=2

        for b in range(16):
            u=now
            
            for t in range(16):
                if k & (1<<t) != 0:
                    u |= 1<< ((b+t)%16)

            DP[i|(1<<j)]=max(DP[i|(1<<j)],u)

print(DP[-1])
0