結果
問題 |
No.2071 Shift and OR
|
ユーザー |
|
提出日時 | 2022-09-16 22:58:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 74,792 KB |
最終ジャッジ日時 | 2024-12-21 22:27:03 |
合計ジャッジ時間 | 105,259 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 TLE * 34 |
ソースコード
import sys sys.setrecursionlimit(10**9) N = int(input()) A = list(map(int, input().split())) ans = 0 def shift(x): return x // 2 + 2**15 * (x % 2) def dfs(v, i): global ans if i == N: # if ans < v: # print(bin(v)) ans = max(v, ans) return # p = 0 # while 2**p < A[i]: # p += 1 dfs(v | A[i], i + 1) x = A[i] # print(p) for j in range(15): x = shift(x) # print(f"x = {x}, v={v}") dfs(v | x, i + 1) dfs(0, 0) print(ans)