結果

問題 No.2071 Shift and OR
ユーザー H20
提出日時 2022-09-16 22:02:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,745 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 102,272 KB
最終ジャッジ日時 2024-12-21 20:20:16
合計ジャッジ時間 59,523 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

from time import time
from random import shuffle

stime = time()
N = int(input())
A = list(map(int, input().split()))
if N >= 15:
    print(2**16-1)
    exit()
ans = 0
while stime+1.7 > time():
    v = 0
    nv = 0
    shuffle(A)
    for a in A:
        for i in range(16):
            nv = max(v|a,nv)
            a = a//2+2**15*(a%2)
        v = nv

    ans = max(v,ans)
print(ans)
0