結果

問題 No.2071 Shift and OR
ユーザー 👑 KazunKazun
提出日時 2022-09-16 21:40:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 106,200 KB
最終ジャッジ日時 2023-08-23 14:40:09
合計ジャッジ時間 6,363 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
78,656 KB
testcase_01 AC 92 ms
79,716 KB
testcase_02 AC 101 ms
82,400 KB
testcase_03 AC 109 ms
85,900 KB
testcase_04 AC 110 ms
84,908 KB
testcase_05 AC 123 ms
88,884 KB
testcase_06 AC 108 ms
85,348 KB
testcase_07 AC 104 ms
83,236 KB
testcase_08 AC 109 ms
84,316 KB
testcase_09 AC 110 ms
85,048 KB
testcase_10 AC 111 ms
85,056 KB
testcase_11 AC 129 ms
89,856 KB
testcase_12 AC 130 ms
90,860 KB
testcase_13 AC 126 ms
88,824 KB
testcase_14 AC 84 ms
77,208 KB
testcase_15 AC 118 ms
86,812 KB
testcase_16 AC 118 ms
86,940 KB
testcase_17 AC 129 ms
89,732 KB
testcase_18 AC 92 ms
79,912 KB
testcase_19 AC 133 ms
91,212 KB
testcase_20 AC 133 ms
90,420 KB
testcase_21 AC 146 ms
94,156 KB
testcase_22 AC 138 ms
92,596 KB
testcase_23 AC 110 ms
102,760 KB
testcase_24 AC 79 ms
76,204 KB
testcase_25 AC 92 ms
87,884 KB
testcase_26 AC 96 ms
89,568 KB
testcase_27 AC 77 ms
75,620 KB
testcase_28 AC 115 ms
106,040 KB
testcase_29 AC 114 ms
106,200 KB
testcase_30 AC 113 ms
87,120 KB
testcase_31 AC 111 ms
85,708 KB
testcase_32 AC 112 ms
86,276 KB
testcase_33 AC 111 ms
86,204 KB
testcase_34 AC 111 ms
86,372 KB
testcase_35 AC 113 ms
86,420 KB
testcase_36 AC 113 ms
87,200 KB
testcase_37 AC 114 ms
86,788 KB
testcase_38 AC 116 ms
86,460 KB
testcase_39 AC 115 ms
86,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def shift(x):
	return x//2+pow(2,15)*(x%2)

def solve():
	N=int(input())
	A=list(map(int,input().split()))
	
	if N>=16:
		return (1<<16)-1
		
	X=1<<16
	D=[0]*X; D[0]=1
	
	for a in A:
		E=D.copy()
		D=[0]*X
		for _ in range(16):
			for x in range(X):
				D[x|a]|=E[x]
			a=shift(a)
	
	return max([i for i in range(X) if D[i]])

print(solve())
0