結果
| 問題 | No.2071 Shift and OR |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-09-16 22:17:03 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 605 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 642,216 KB |
| 最終ジャッジ日時 | 2026-05-28 10:15:03 |
| 合計ジャッジ時間 | 5,001 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 1 MLE * 1 -- * 34 |
ソースコード
import sys
input = sys.stdin.readline
from itertools import permutations
def shift(x):
return x//2+(1<<15)*(x%2)
N=int(input())
A=list(map(int,input().split()))
if N>=16:
print(2**16-1)
exit()
ANS=0
L=list(permutations(range(N)))
for l in L:
DP=[0]*16
for i in l:
k=A[i]
while k%2==0:
k//=2
for j in range(16):
if DP[j]==0:
break
for b in range(16):
if (1<<b) & k != 0:
if j+b<16:
DP[j+b]=1
X="".join(map(str,DP))
ANS=max(ANS,int(X,2))
print(ANS)
titia