結果

問題 No.2071 Shift and OR
ユーザー titiatitia
提出日時 2022-09-17 01:23:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,025 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 104,888 KB
最終ジャッジ日時 2023-08-23 17:21:12
合計ジャッジ時間 11,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,836 KB
testcase_01 AC 80 ms
76,868 KB
testcase_02 AC 90 ms
76,676 KB
testcase_03 AC 242 ms
77,220 KB
testcase_04 AC 127 ms
77,220 KB
testcase_05 AC 420 ms
77,156 KB
testcase_06 AC 154 ms
77,512 KB
testcase_07 AC 102 ms
77,044 KB
testcase_08 AC 118 ms
77,376 KB
testcase_09 AC 148 ms
77,212 KB
testcase_10 AC 164 ms
77,500 KB
testcase_11 AC 473 ms
77,396 KB
testcase_12 AC 412 ms
77,352 KB
testcase_13 AC 412 ms
77,132 KB
testcase_14 AC 72 ms
75,752 KB
testcase_15 AC 311 ms
77,252 KB
testcase_16 AC 289 ms
77,360 KB
testcase_17 AC 481 ms
77,504 KB
testcase_18 AC 82 ms
76,848 KB
testcase_19 AC 598 ms
77,312 KB
testcase_20 AC 564 ms
77,504 KB
testcase_21 AC 758 ms
77,136 KB
testcase_22 AC 1,025 ms
77,340 KB
testcase_23 AC 102 ms
101,156 KB
testcase_24 AC 75 ms
75,876 KB
testcase_25 AC 85 ms
86,768 KB
testcase_26 AC 88 ms
88,748 KB
testcase_27 AC 70 ms
75,708 KB
testcase_28 AC 107 ms
104,704 KB
testcase_29 AC 107 ms
104,888 KB
testcase_30 AC 223 ms
77,108 KB
testcase_31 AC 125 ms
77,160 KB
testcase_32 AC 131 ms
77,216 KB
testcase_33 AC 142 ms
77,052 KB
testcase_34 AC 168 ms
77,400 KB
testcase_35 AC 178 ms
77,224 KB
testcase_36 AC 213 ms
77,156 KB
testcase_37 AC 160 ms
77,480 KB
testcase_38 AC 148 ms
77,360 KB
testcase_39 AC 145 ms
77,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

if N>=16:
    print(2**16-1)
    exit()

DP=[0]*(1<<16)
DP[0]=1

for a in A:
    k=a
    while k%2==0:
        k//=2

    for i in range((1<<16)-1,-1,-1):
        if DP[i]==1:
            for b in range(16):
                u=i
                
                for t in range(16):
                    if k & (1<<t) != 0:
                        u |= 1<< ((b+t)%16)

                DP[u]=1

ANS=0
for i in range(1<<16):
    if DP[i]==1:
        ANS=i

print(ANS)
0