結果

問題 No.2071 Shift and OR
ユーザー 👑 rin204rin204
提出日時 2022-09-16 21:24:07
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 283 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 126,724 KB
最終ジャッジ日時 2023-08-23 14:23:34
合計ジャッジ時間 6,576 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,580 KB
testcase_01 AC 75 ms
76,200 KB
testcase_02 AC 80 ms
78,568 KB
testcase_03 AC 122 ms
93,356 KB
testcase_04 AC 93 ms
85,052 KB
testcase_05 AC 157 ms
108,160 KB
testcase_06 AC 115 ms
88,776 KB
testcase_07 AC 81 ms
80,388 KB
testcase_08 AC 85 ms
81,840 KB
testcase_09 AC 96 ms
86,788 KB
testcase_10 AC 100 ms
88,900 KB
testcase_11 AC 174 ms
116,192 KB
testcase_12 AC 175 ms
117,976 KB
testcase_13 AC 153 ms
105,872 KB
testcase_14 AC 70 ms
71,436 KB
testcase_15 AC 133 ms
99,092 KB
testcase_16 AC 130 ms
99,384 KB
testcase_17 AC 226 ms
111,020 KB
testcase_18 AC 74 ms
75,996 KB
testcase_19 AC 283 ms
126,724 KB
testcase_20 AC 172 ms
113,096 KB
testcase_21 AC 215 ms
122,992 KB
testcase_22 AC 199 ms
123,732 KB
testcase_23 AC 103 ms
102,588 KB
testcase_24 AC 74 ms
76,240 KB
testcase_25 AC 86 ms
87,676 KB
testcase_26 AC 88 ms
89,460 KB
testcase_27 AC 72 ms
75,752 KB
testcase_28 AC 105 ms
106,048 KB
testcase_29 AC 106 ms
106,000 KB
testcase_30 AC 155 ms
101,268 KB
testcase_31 AC 90 ms
83,692 KB
testcase_32 AC 95 ms
86,448 KB
testcase_33 AC 100 ms
87,716 KB
testcase_34 AC 127 ms
90,104 KB
testcase_35 AC 112 ms
93,740 KB
testcase_36 AC 124 ms
99,976 KB
testcase_37 AC 102 ms
89,984 KB
testcase_38 AC 96 ms
88,008 KB
testcase_39 AC 94 ms
84,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
if n >= 16:
    print((1 << 16) - 1)
    exit()

se = {0}
for a in A:
    nex = set()
    cand = set()
    for _ in range(16):
        cand.add(a)
        t = a & 1
        a >>= 1
        if t:
            a |= 1 << 15
    
    for a in cand:
        for b in se:
            nex.add(a | b)
    se = nex
print(max(se))
        
0