結果

問題 No.2071 Shift and OR
ユーザー titiatitia
提出日時 2022-09-16 22:14:14
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 9,796 KB
最終ジャッジ日時 2023-08-23 15:51:03
合計ジャッジ時間 4,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,148 KB
testcase_01 AC 16 ms
8,164 KB
testcase_02 AC 17 ms
8,184 KB
testcase_03 WA -
testcase_04 AC 35 ms
8,344 KB
testcase_05 TLE -
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=[]

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
    ANS.append(DP)

#print(ANS)

MAX=max(ANS)

X="".join(map(str,MAX))

print(int(X,2))
0