結果
問題 | No.2071 Shift and OR |
ユーザー |
|
提出日時 | 2022-09-16 22:58:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 526 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 71,772 KB |
最終ジャッジ日時 | 2024-12-21 22:24:25 |
合計ジャッジ時間 | 106,192 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 3 TLE * 34 |
ソースコード
import syssys.setrecursionlimit(10**9)N = int(input())A = list(map(int, input().split()))ans = 0def shift(x):return x // 2 + 2**15 * (x % 2)def dfs(v, i):global ansif i == N:if ans < v:print(bin(v))ans = max(v, ans)return# p = 0# while 2**p < A[i]:# p += 1dfs(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)