結果

問題 No.2071 Shift and OR
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2022-09-09 22:37:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 102,016 KB
最終ジャッジ日時 2024-05-04 12:30:06
合計ジャッジ時間 7,220 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,040 KB
testcase_01 AC 104 ms
74,624 KB
testcase_02 AC 130 ms
79,872 KB
testcase_03 AC 150 ms
80,768 KB
testcase_04 AC 138 ms
80,512 KB
testcase_05 AC 180 ms
82,432 KB
testcase_06 AC 138 ms
80,384 KB
testcase_07 AC 127 ms
79,872 KB
testcase_08 AC 141 ms
80,384 KB
testcase_09 AC 139 ms
80,640 KB
testcase_10 AC 139 ms
80,384 KB
testcase_11 AC 190 ms
82,944 KB
testcase_12 AC 189 ms
83,200 KB
testcase_13 AC 179 ms
82,304 KB
testcase_14 AC 75 ms
65,280 KB
testcase_15 AC 160 ms
81,536 KB
testcase_16 AC 161 ms
81,280 KB
testcase_17 AC 191 ms
82,944 KB
testcase_18 AC 102 ms
74,368 KB
testcase_19 AC 202 ms
83,584 KB
testcase_20 AC 200 ms
83,456 KB
testcase_21 AC 232 ms
85,248 KB
testcase_22 AC 211 ms
84,224 KB
testcase_23 AC 86 ms
97,536 KB
testcase_24 AC 49 ms
61,312 KB
testcase_25 AC 67 ms
77,056 KB
testcase_26 AC 69 ms
79,616 KB
testcase_27 AC 45 ms
58,112 KB
testcase_28 AC 90 ms
102,016 KB
testcase_29 AC 90 ms
101,504 KB
testcase_30 AC 149 ms
81,152 KB
testcase_31 AC 149 ms
81,024 KB
testcase_32 AC 149 ms
81,152 KB
testcase_33 AC 153 ms
80,896 KB
testcase_34 AC 149 ms
80,896 KB
testcase_35 AC 151 ms
81,024 KB
testcase_36 AC 152 ms
81,024 KB
testcase_37 AC 151 ms
80,896 KB
testcase_38 AC 149 ms
81,280 KB
testcase_39 AC 150 ms
81,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


n=int(input())
def shift(x):
    return x//2+(2**15)*(x%2)
a=[0]+list(map(int,input().split()))
if n>=16:
    print(2**16-1)
    exit()
dp=[[0]*(2**16) for i in range(n+3)]
dp[0][0]=1
for i in range(1,n+1):
    for j in range(2**16):
        for iii in range(16):
            dp[i][j|a[i]]|=dp[i-1][j]
            a[i]=shift(a[i])
for j in range(2**16-1,-1,-1):
    if dp[n][j]:
        print(j)
        exit()


0