結果

問題 No.2071 Shift and OR
ユーザー とりゐとりゐ
提出日時 2022-09-16 21:30:10
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 654 ms
使用メモリ 110,752 KB
最終ジャッジ日時 2023-01-11 06:01:28
合計ジャッジ時間 7,006 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 86 ms
82,244 KB
testcase_01 AC 89 ms
82,724 KB
testcase_02 AC 99 ms
83,624 KB
testcase_03 AC 130 ms
84,764 KB
testcase_04 AC 110 ms
84,328 KB
testcase_05 AC 171 ms
86,388 KB
testcase_06 AC 118 ms
84,628 KB
testcase_07 AC 102 ms
83,732 KB
testcase_08 AC 109 ms
84,132 KB
testcase_09 AC 114 ms
84,252 KB
testcase_10 AC 114 ms
84,652 KB
testcase_11 AC 171 ms
86,944 KB
testcase_12 AC 171 ms
86,840 KB
testcase_13 AC 160 ms
86,200 KB
testcase_14 AC 78 ms
81,332 KB
testcase_15 AC 142 ms
85,448 KB
testcase_16 AC 141 ms
85,316 KB
testcase_17 AC 174 ms
86,956 KB
testcase_18 AC 88 ms
82,704 KB
testcase_19 AC 199 ms
87,668 KB
testcase_20 AC 188 ms
87,440 KB
testcase_21 AC 225 ms
89,068 KB
testcase_22 AC 207 ms
87,944 KB
testcase_23 AC 105 ms
107,300 KB
testcase_24 AC 74 ms
80,892 KB
testcase_25 AC 86 ms
91,968 KB
testcase_26 AC 90 ms
93,944 KB
testcase_27 AC 71 ms
80,444 KB
testcase_28 AC 107 ms
110,752 KB
testcase_29 AC 109 ms
110,688 KB
testcase_30 AC 134 ms
84,796 KB
testcase_31 AC 116 ms
84,828 KB
testcase_32 AC 118 ms
84,796 KB
testcase_33 AC 118 ms
84,828 KB
testcase_34 AC 121 ms
84,804 KB
testcase_35 AC 122 ms
84,804 KB
testcase_36 AC 130 ms
84,808 KB
testcase_37 AC 121 ms
84,816 KB
testcase_38 AC 117 ms
84,996 KB
testcase_39 AC 117 ms
84,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def shift(x):
  if x%2==1:
    return (1<<15)+x//2
  else:
    return x//2

ok=[0]*m
ok[0]=1

for ai in a:
  nok=[0]*m
  for _ in range(20):
    ai=shift(ai)
    for j in range(m):
      if ok[j]:
        nok[j|ai]=1
  
  ok=nok
ans=0
for i in range(m):
  if ok[i]:
    ans=i

print(ans)
0