結果

問題 No.2071 Shift and OR
ユーザー rin204rin204
提出日時 2022-09-16 21:24:07
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 254 ms
使用メモリ 131,208 KB
最終ジャッジ日時 2023-01-11 05:53:41
合計ジャッジ時間 7,479 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 83 ms
75,488 KB
testcase_01 AC 87 ms
80,820 KB
testcase_02 AC 93 ms
82,872 KB
testcase_03 AC 131 ms
97,968 KB
testcase_04 AC 107 ms
89,876 KB
testcase_05 AC 174 ms
112,916 KB
testcase_06 AC 128 ms
93,544 KB
testcase_07 AC 96 ms
85,100 KB
testcase_08 AC 100 ms
86,328 KB
testcase_09 AC 113 ms
91,448 KB
testcase_10 AC 114 ms
93,652 KB
testcase_11 AC 192 ms
120,636 KB
testcase_12 AC 192 ms
122,636 KB
testcase_13 AC 170 ms
110,492 KB
testcase_14 AC 83 ms
75,652 KB
testcase_15 AC 146 ms
103,292 KB
testcase_16 AC 144 ms
104,000 KB
testcase_17 AC 234 ms
115,536 KB
testcase_18 AC 87 ms
80,576 KB
testcase_19 AC 287 ms
131,208 KB
testcase_20 AC 189 ms
117,756 KB
testcase_21 AC 232 ms
123,132 KB
testcase_22 AC 217 ms
128,368 KB
testcase_23 AC 119 ms
107,228 KB
testcase_24 AC 86 ms
80,872 KB
testcase_25 AC 100 ms
91,960 KB
testcase_26 AC 106 ms
94,280 KB
testcase_27 AC 85 ms
80,276 KB
testcase_28 AC 121 ms
110,640 KB
testcase_29 AC 123 ms
110,680 KB
testcase_30 AC 168 ms
105,564 KB
testcase_31 AC 104 ms
88,640 KB
testcase_32 AC 108 ms
91,040 KB
testcase_33 AC 112 ms
92,516 KB
testcase_34 AC 133 ms
94,580 KB
testcase_35 AC 123 ms
98,216 KB
testcase_36 AC 138 ms
104,656 KB
testcase_37 AC 117 ms
94,652 KB
testcase_38 AC 111 ms
92,568 KB
testcase_39 AC 108 ms
89,644 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