結果

問題 No.2071 Shift and OR
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2022-09-09 22:37:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 107,668 KB
最終ジャッジ日時 2023-08-17 05:33:11
合計ジャッジ時間 8,833 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
79,148 KB
testcase_01 AC 127 ms
79,768 KB
testcase_02 AC 142 ms
81,180 KB
testcase_03 AC 167 ms
82,448 KB
testcase_04 AC 156 ms
81,792 KB
testcase_05 AC 194 ms
83,900 KB
testcase_06 AC 155 ms
81,776 KB
testcase_07 AC 144 ms
81,288 KB
testcase_08 AC 156 ms
81,884 KB
testcase_09 AC 155 ms
81,784 KB
testcase_10 AC 157 ms
81,680 KB
testcase_11 AC 206 ms
84,280 KB
testcase_12 AC 208 ms
84,208 KB
testcase_13 AC 197 ms
83,720 KB
testcase_14 AC 101 ms
78,652 KB
testcase_15 AC 175 ms
82,576 KB
testcase_16 AC 178 ms
82,800 KB
testcase_17 AC 210 ms
84,416 KB
testcase_18 AC 123 ms
79,728 KB
testcase_19 AC 216 ms
84,740 KB
testcase_20 AC 217 ms
84,880 KB
testcase_21 AC 248 ms
86,320 KB
testcase_22 AC 229 ms
85,300 KB
testcase_23 AC 111 ms
104,060 KB
testcase_24 AC 79 ms
76,516 KB
testcase_25 AC 90 ms
88,384 KB
testcase_26 AC 94 ms
90,420 KB
testcase_27 AC 74 ms
75,860 KB
testcase_28 AC 115 ms
107,668 KB
testcase_29 AC 114 ms
107,624 KB
testcase_30 AC 167 ms
82,064 KB
testcase_31 AC 166 ms
82,436 KB
testcase_32 AC 164 ms
81,988 KB
testcase_33 AC 168 ms
82,204 KB
testcase_34 AC 166 ms
82,280 KB
testcase_35 AC 167 ms
82,424 KB
testcase_36 AC 166 ms
82,296 KB
testcase_37 AC 166 ms
82,204 KB
testcase_38 AC 165 ms
82,192 KB
testcase_39 AC 169 ms
82,192 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