結果

問題 No.2071 Shift and OR
ユーザー flygonflygon
提出日時 2022-09-16 22:08:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 116,672 KB
最終ジャッジ日時 2023-08-23 15:42:11
合計ジャッジ時間 8,412 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
78,852 KB
testcase_01 AC 91 ms
79,696 KB
testcase_02 AC 103 ms
81,868 KB
testcase_03 AC 136 ms
83,944 KB
testcase_04 AC 116 ms
82,780 KB
testcase_05 AC 177 ms
86,908 KB
testcase_06 AC 123 ms
82,880 KB
testcase_07 AC 105 ms
81,776 KB
testcase_08 AC 112 ms
82,928 KB
testcase_09 AC 116 ms
82,872 KB
testcase_10 AC 117 ms
82,808 KB
testcase_11 AC 180 ms
88,448 KB
testcase_12 AC 184 ms
88,572 KB
testcase_13 AC 170 ms
86,920 KB
testcase_14 AC 80 ms
77,344 KB
testcase_15 AC 154 ms
84,952 KB
testcase_16 AC 150 ms
85,028 KB
testcase_17 AC 187 ms
88,448 KB
testcase_18 AC 92 ms
79,760 KB
testcase_19 AC 211 ms
89,112 KB
testcase_20 AC 207 ms
89,164 KB
testcase_21 AC 241 ms
90,440 KB
testcase_22 AC 193 ms
89,696 KB
testcase_23 AC 199 ms
116,672 KB
testcase_24 AC 180 ms
93,928 KB
testcase_25 AC 181 ms
105,640 KB
testcase_26 AC 189 ms
107,628 KB
testcase_27 AC 167 ms
93,588 KB
testcase_28 AC 205 ms
115,400 KB
testcase_29 AC 208 ms
115,292 KB
testcase_30 AC 135 ms
83,840 KB
testcase_31 AC 118 ms
83,940 KB
testcase_32 AC 118 ms
83,992 KB
testcase_33 AC 123 ms
84,048 KB
testcase_34 AC 124 ms
84,076 KB
testcase_35 AC 130 ms
84,060 KB
testcase_36 AC 132 ms
83,684 KB
testcase_37 AC 124 ms
83,816 KB
testcase_38 AC 121 ms
83,996 KB
testcase_39 AC 122 ms
83,996 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