結果

問題 No.2071 Shift and OR
ユーザー AEnAEn
提出日時 2022-12-15 23:39:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,632 KB
実行使用メモリ 101,120 KB
最終ジャッジ日時 2024-04-26 23:21:22
合計ジャッジ時間 4,874 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
60,448 KB
testcase_01 AC 50 ms
63,524 KB
testcase_02 AC 54 ms
64,584 KB
testcase_03 AC 71 ms
69,888 KB
testcase_04 AC 61 ms
66,892 KB
testcase_05 WA -
testcase_06 AC 64 ms
67,252 KB
testcase_07 AC 56 ms
65,232 KB
testcase_08 AC 59 ms
66,204 KB
testcase_09 AC 60 ms
67,460 KB
testcase_10 AC 63 ms
66,720 KB
testcase_11 AC 97 ms
76,220 KB
testcase_12 AC 93 ms
75,336 KB
testcase_13 WA -
testcase_14 AC 44 ms
58,708 KB
testcase_15 WA -
testcase_16 AC 79 ms
71,300 KB
testcase_17 WA -
testcase_18 AC 50 ms
63,996 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 73 ms
96,288 KB
testcase_24 AC 43 ms
62,844 KB
testcase_25 AC 55 ms
77,352 KB
testcase_26 AC 59 ms
79,684 KB
testcase_27 AC 41 ms
58,280 KB
testcase_28 AC 79 ms
100,868 KB
testcase_29 AC 79 ms
101,120 KB
testcase_30 AC 69 ms
68,904 KB
testcase_31 AC 60 ms
66,604 KB
testcase_32 AC 61 ms
67,080 KB
testcase_33 AC 63 ms
67,368 KB
testcase_34 AC 65 ms
69,024 KB
testcase_35 AC 67 ms
67,616 KB
testcase_36 AC 68 ms
69,228 KB
testcase_37 AC 64 ms
67,760 KB
testcase_38 AC 65 ms
67,760 KB
testcase_39 AC 65 ms
66,528 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