結果
問題 | No.2071 Shift and OR |
ユーザー |
|
提出日時 | 2022-09-16 22:08:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 221 ms / 2,000 ms |
コード長 | 415 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 125,896 KB |
最終ジャッジ日時 | 2024-12-21 20:54:46 |
合計ジャッジ時間 | 6,330 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
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()