結果

問題 No.2071 Shift and OR
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2022-09-09 22:37:24
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 254 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 292 ms
使用メモリ 112,420 KB
最終ジャッジ日時 2022-12-31 01:17:50
合計ジャッジ時間 8,751 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 120 ms
83,736 KB
testcase_01 AC 133 ms
84,564 KB
testcase_02 AC 152 ms
85,504 KB
testcase_03 AC 173 ms
86,364 KB
testcase_04 AC 160 ms
85,864 KB
testcase_05 AC 204 ms
87,840 KB
testcase_06 AC 161 ms
85,996 KB
testcase_07 AC 151 ms
85,504 KB
testcase_08 AC 162 ms
85,976 KB
testcase_09 AC 163 ms
86,112 KB
testcase_10 AC 161 ms
85,908 KB
testcase_11 AC 213 ms
88,580 KB
testcase_12 AC 212 ms
88,444 KB
testcase_13 AC 203 ms
88,060 KB
testcase_14 AC 103 ms
82,856 KB
testcase_15 AC 181 ms
86,712 KB
testcase_16 AC 181 ms
87,140 KB
testcase_17 AC 213 ms
88,264 KB
testcase_18 AC 132 ms
84,560 KB
testcase_19 AC 225 ms
89,344 KB
testcase_20 AC 225 ms
89,096 KB
testcase_21 AC 254 ms
90,748 KB
testcase_22 AC 234 ms
89,656 KB
testcase_23 AC 113 ms
108,912 KB
testcase_24 AC 79 ms
81,060 KB
testcase_25 AC 93 ms
92,860 KB
testcase_26 AC 95 ms
94,876 KB
testcase_27 AC 76 ms
80,360 KB
testcase_28 AC 117 ms
112,308 KB
testcase_29 AC 114 ms
112,420 KB
testcase_30 AC 172 ms
86,192 KB
testcase_31 AC 172 ms
86,628 KB
testcase_32 AC 171 ms
86,752 KB
testcase_33 AC 171 ms
86,196 KB
testcase_34 AC 172 ms
86,616 KB
testcase_35 AC 172 ms
86,560 KB
testcase_36 AC 172 ms
86,368 KB
testcase_37 AC 170 ms
86,192 KB
testcase_38 AC 170 ms
86,520 KB
testcase_39 AC 169 ms
86,616 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