結果

問題 No.2071 Shift and OR
ユーザー vwxyzvwxyz
提出日時 2023-02-24 07:24:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 364 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 101,576 KB
最終ジャッジ日時 2023-10-01 04:45:17
合計ジャッジ時間 10,239 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
77,908 KB
testcase_01 AC 137 ms
78,868 KB
testcase_02 AC 163 ms
79,700 KB
testcase_03 AC 211 ms
80,696 KB
testcase_04 AC 183 ms
80,204 KB
testcase_05 AC 264 ms
82,028 KB
testcase_06 AC 188 ms
80,012 KB
testcase_07 AC 167 ms
79,476 KB
testcase_08 AC 179 ms
80,204 KB
testcase_09 AC 203 ms
79,972 KB
testcase_10 AC 205 ms
80,120 KB
testcase_11 AC 283 ms
82,684 KB
testcase_12 AC 282 ms
82,740 KB
testcase_13 AC 263 ms
82,048 KB
testcase_14 AC 105 ms
77,440 KB
testcase_15 AC 229 ms
81,088 KB
testcase_16 AC 233 ms
81,012 KB
testcase_17 AC 286 ms
82,828 KB
testcase_18 AC 136 ms
79,064 KB
testcase_19 AC 293 ms
82,512 KB
testcase_20 AC 304 ms
82,548 KB
testcase_21 AC 364 ms
82,676 KB
testcase_22 AC 327 ms
82,528 KB
testcase_23 AC 111 ms
101,576 KB
testcase_24 AC 81 ms
76,308 KB
testcase_25 AC 92 ms
87,056 KB
testcase_26 AC 100 ms
88,928 KB
testcase_27 AC 78 ms
75,944 KB
testcase_28 AC 122 ms
98,072 KB
testcase_29 AC 122 ms
98,124 KB
testcase_30 AC 208 ms
80,348 KB
testcase_31 AC 194 ms
80,488 KB
testcase_32 AC 198 ms
80,576 KB
testcase_33 AC 196 ms
80,576 KB
testcase_34 AC 219 ms
80,476 KB
testcase_35 AC 203 ms
80,500 KB
testcase_36 AC 214 ms
80,532 KB
testcase_37 AC 201 ms
80,704 KB
testcase_38 AC 197 ms
80,356 KB
testcase_39 AC 196 ms
80,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
import heapq

N=int(readline())
A=list(map(int,readline().split()))
if N>=16:
    ans=(1<<16)-1
else:
    dp=[False]*(1<<16)
    dp[0]=True
    for a in A:
        prev=dp
        dp=[False]*(1<<16)
        for bit in range(1<<16):
            for i in range(16):
                dp[bit|a]|=prev[bit]
                a=a>>1|(a&1)<<15
    for ans in range((1<<16)-1,-1,-1):
        if dp[ans]:
            break
print(ans)
0