結果

問題 No.2071 Shift and OR
ユーザー titiatitia
提出日時 2022-09-16 22:17:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 641,464 KB
最終ジャッジ日時 2023-08-23 15:56:43
合計ジャッジ時間 4,681 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,772 KB
testcase_01 AC 70 ms
71,548 KB
testcase_02 AC 84 ms
76,872 KB
testcase_03 WA -
testcase_04 AC 91 ms
77,160 KB
testcase_05 MLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from itertools import permutations

def shift(x):
    return x//2+(1<<15)*(x%2)

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

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

ANS=0

L=list(permutations(range(N)))

for l in L:
    DP=[0]*16
    for i in l:
        k=A[i]

        while k%2==0:
            k//=2

        for j in range(16):
            if DP[j]==0:
                break

        for b in range(16):
            if (1<<b) & k != 0:
                if j+b<16:
                    DP[j+b]=1

    X="".join(map(str,DP))
    ANS=max(ANS,int(X,2))

print(ANS)
0