結果

問題 No.2071 Shift and OR
ユーザー flygonflygon
提出日時 2022-09-16 22:08:01
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 277 ms
使用メモリ 113,876 KB
最終ジャッジ日時 2023-01-11 07:10:26
合計ジャッジ時間 7,967 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 90 ms
83,216 KB
testcase_01 AC 94 ms
84,456 KB
testcase_02 AC 102 ms
86,688 KB
testcase_03 AC 134 ms
88,376 KB
testcase_04 AC 114 ms
87,604 KB
testcase_05 AC 177 ms
91,696 KB
testcase_06 AC 122 ms
87,364 KB
testcase_07 AC 106 ms
86,160 KB
testcase_08 AC 113 ms
87,604 KB
testcase_09 AC 117 ms
87,608 KB
testcase_10 AC 119 ms
87,632 KB
testcase_11 AC 180 ms
92,608 KB
testcase_12 AC 184 ms
92,956 KB
testcase_13 AC 169 ms
91,828 KB
testcase_14 AC 83 ms
81,844 KB
testcase_15 AC 150 ms
89,444 KB
testcase_16 AC 148 ms
89,636 KB
testcase_17 AC 190 ms
92,976 KB
testcase_18 AC 94 ms
84,236 KB
testcase_19 AC 213 ms
93,520 KB
testcase_20 AC 208 ms
93,136 KB
testcase_21 AC 242 ms
95,032 KB
testcase_22 AC 184 ms
93,900 KB
testcase_23 AC 206 ms
110,144 KB
testcase_24 AC 173 ms
98,036 KB
testcase_25 AC 187 ms
111,696 KB
testcase_26 AC 192 ms
113,876 KB
testcase_27 AC 171 ms
97,692 KB
testcase_28 AC 206 ms
113,140 KB
testcase_29 AC 207 ms
113,184 KB
testcase_30 AC 135 ms
88,404 KB
testcase_31 AC 117 ms
88,548 KB
testcase_32 AC 119 ms
88,416 KB
testcase_33 AC 122 ms
88,228 KB
testcase_34 AC 126 ms
88,640 KB
testcase_35 AC 126 ms
88,772 KB
testcase_36 AC 133 ms
88,368 KB
testcase_37 AC 123 ms
88,412 KB
testcase_38 AC 120 ms
88,640 KB
testcase_39 AC 120 ms
88,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
b = [0]*((1<<16)+10)

def f(x):
  return x//2 + pow(2,15)*(x%2)
b[0] = 1
for i in range(min(n, 20)):
  now = a[i]
  new = [0]*((1<<16)+10)
  new[0] = 1
  for j in range(20):
    tmp = f(now)
    for k in range((1<<16)+10):
      if b[k]:
        new[k|tmp] = 1
    now = tmp
  b = new[::1]
for i in range((1<<16)+10)[::-1]:
  if b[i]:
    print(i)
    exit()




0