結果

問題 No.2071 Shift and OR
ユーザー とりゐとりゐ
提出日時 2022-09-16 21:30:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 106,152 KB
最終ジャッジ日時 2023-08-23 14:28:07
合計ジャッジ時間 7,133 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
77,724 KB
testcase_01 AC 94 ms
78,364 KB
testcase_02 AC 104 ms
79,384 KB
testcase_03 AC 134 ms
80,144 KB
testcase_04 AC 118 ms
79,832 KB
testcase_05 AC 174 ms
81,864 KB
testcase_06 AC 120 ms
79,840 KB
testcase_07 AC 106 ms
79,308 KB
testcase_08 AC 115 ms
79,892 KB
testcase_09 AC 119 ms
79,896 KB
testcase_10 AC 119 ms
79,836 KB
testcase_11 AC 177 ms
82,380 KB
testcase_12 AC 178 ms
82,548 KB
testcase_13 AC 167 ms
81,892 KB
testcase_14 AC 81 ms
76,888 KB
testcase_15 AC 147 ms
80,840 KB
testcase_16 AC 148 ms
80,740 KB
testcase_17 AC 182 ms
82,384 KB
testcase_18 AC 93 ms
78,244 KB
testcase_19 AC 210 ms
83,472 KB
testcase_20 AC 199 ms
83,460 KB
testcase_21 AC 239 ms
84,920 KB
testcase_22 AC 220 ms
84,004 KB
testcase_23 AC 110 ms
102,744 KB
testcase_24 AC 77 ms
76,308 KB
testcase_25 AC 91 ms
87,620 KB
testcase_26 AC 94 ms
89,624 KB
testcase_27 AC 75 ms
75,860 KB
testcase_28 AC 113 ms
106,152 KB
testcase_29 AC 110 ms
106,112 KB
testcase_30 AC 134 ms
80,344 KB
testcase_31 AC 119 ms
80,344 KB
testcase_32 AC 117 ms
80,416 KB
testcase_33 AC 123 ms
80,468 KB
testcase_34 AC 126 ms
80,440 KB
testcase_35 AC 127 ms
80,428 KB
testcase_36 AC 132 ms
80,316 KB
testcase_37 AC 123 ms
80,344 KB
testcase_38 AC 120 ms
80,236 KB
testcase_39 AC 122 ms
80,456 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