結果

問題 No.2071 Shift and OR
ユーザー AEnAEn
提出日時 2022-12-15 23:42:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 105,916 KB
最終ジャッジ日時 2023-08-09 08:49:48
合計ジャッジ時間 6,407 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
77,300 KB
testcase_01 AC 84 ms
78,688 KB
testcase_02 AC 90 ms
79,464 KB
testcase_03 AC 105 ms
80,680 KB
testcase_04 AC 92 ms
80,108 KB
testcase_05 AC 128 ms
82,228 KB
testcase_06 AC 94 ms
80,244 KB
testcase_07 AC 87 ms
79,584 KB
testcase_08 AC 90 ms
79,848 KB
testcase_09 AC 95 ms
79,932 KB
testcase_10 AC 96 ms
80,060 KB
testcase_11 AC 143 ms
83,000 KB
testcase_12 AC 145 ms
83,100 KB
testcase_13 AC 127 ms
81,908 KB
testcase_14 AC 74 ms
76,588 KB
testcase_15 AC 114 ms
80,876 KB
testcase_16 AC 114 ms
80,980 KB
testcase_17 AC 141 ms
83,044 KB
testcase_18 AC 81 ms
78,484 KB
testcase_19 AC 158 ms
83,408 KB
testcase_20 AC 147 ms
83,532 KB
testcase_21 AC 175 ms
85,064 KB
testcase_22 AC 163 ms
84,264 KB
testcase_23 AC 104 ms
102,704 KB
testcase_24 AC 76 ms
76,332 KB
testcase_25 AC 86 ms
87,532 KB
testcase_26 AC 87 ms
89,472 KB
testcase_27 AC 71 ms
75,792 KB
testcase_28 AC 105 ms
105,872 KB
testcase_29 AC 104 ms
105,916 KB
testcase_30 AC 108 ms
80,564 KB
testcase_31 AC 96 ms
80,576 KB
testcase_32 AC 92 ms
80,632 KB
testcase_33 AC 95 ms
80,600 KB
testcase_34 AC 98 ms
80,548 KB
testcase_35 AC 98 ms
80,632 KB
testcase_36 AC 104 ms
80,512 KB
testcase_37 AC 96 ms
80,548 KB
testcase_38 AC 97 ms
80,492 KB
testcase_39 AC 96 ms
80,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

def f(x):
    return x//2+(1<<15)*(x&1)
if N>=16:
    exit(print((1<<16)-1))
else:
    dp = [[False]*(1<<16) for _ in range(N+1)]
    dp[0][0] = True
    for i in range(1,N+1):
        for j in range(1<<16):
            if dp[i-1][j]:
                for k in range(16):
                    dp[i][j|A[i-1]] = True
                    A[i-1] = f(A[i-1])
    for i in range((1<<16)-1,-1,-1):
        if dp[-1][i]:
            print(i)
            exit()
0