結果

問題 No.2071 Shift and OR
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-09-16 21:56:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 464 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 106,140 KB
最終ジャッジ日時 2023-08-23 15:20:08
合計ジャッジ時間 5,813 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,600 KB
testcase_01 AC 83 ms
77,192 KB
testcase_02 AC 80 ms
77,104 KB
testcase_03 AC 90 ms
77,316 KB
testcase_04 AC 83 ms
76,960 KB
testcase_05 AC 104 ms
77,516 KB
testcase_06 AC 85 ms
77,104 KB
testcase_07 AC 82 ms
77,088 KB
testcase_08 AC 83 ms
76,796 KB
testcase_09 AC 84 ms
77,244 KB
testcase_10 AC 85 ms
77,192 KB
testcase_11 AC 107 ms
77,512 KB
testcase_12 AC 103 ms
77,340 KB
testcase_13 AC 101 ms
77,412 KB
testcase_14 AC 75 ms
76,284 KB
testcase_15 AC 93 ms
76,964 KB
testcase_16 AC 93 ms
77,104 KB
testcase_17 AC 106 ms
77,728 KB
testcase_18 AC 79 ms
77,080 KB
testcase_19 AC 115 ms
77,560 KB
testcase_20 AC 112 ms
77,376 KB
testcase_21 AC 128 ms
77,556 KB
testcase_22 AC 118 ms
77,600 KB
testcase_23 AC 103 ms
102,628 KB
testcase_24 AC 75 ms
76,400 KB
testcase_25 AC 88 ms
87,712 KB
testcase_26 AC 90 ms
89,660 KB
testcase_27 AC 72 ms
75,736 KB
testcase_28 AC 109 ms
106,140 KB
testcase_29 AC 109 ms
106,028 KB
testcase_30 AC 90 ms
76,928 KB
testcase_31 AC 84 ms
77,248 KB
testcase_32 AC 82 ms
77,244 KB
testcase_33 AC 85 ms
77,112 KB
testcase_34 AC 84 ms
77,148 KB
testcase_35 AC 85 ms
77,148 KB
testcase_36 AC 87 ms
76,956 KB
testcase_37 AC 84 ms
76,948 KB
testcase_38 AC 84 ms
76,996 KB
testcase_39 AC 85 ms
77,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))

if n > 16:
    print(2**16-1)
    exit()


dp = [0]*(1<<16)

dp[0] = 1

for a in A:
    for i in range(1<<16)[::-1]:
        if dp[i] == 0:
            continue
        base = a
        # print("base",base)
        for j in range(16):
            dp[i|base] = 1
            base =  (1<<15)*(base%2) + base//2 
            # print(base)
for i in range(1<<16)[::-1]:
    if dp[i]:
        print(i)
        exit()
0