結果

問題 No.2071 Shift and OR
ユーザー 👑 KazunKazun
提出日時 2022-09-16 21:40:49
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 395 ms
使用メモリ 110,856 KB
最終ジャッジ日時 2023-01-11 06:17:10
合計ジャッジ時間 6,859 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 81 ms
83,176 KB
testcase_01 AC 86 ms
84,116 KB
testcase_02 AC 99 ms
86,848 KB
testcase_03 AC 107 ms
90,616 KB
testcase_04 AC 101 ms
89,680 KB
testcase_05 AC 116 ms
93,392 KB
testcase_06 AC 101 ms
89,688 KB
testcase_07 AC 96 ms
87,856 KB
testcase_08 AC 101 ms
88,728 KB
testcase_09 AC 101 ms
89,616 KB
testcase_10 AC 101 ms
89,488 KB
testcase_11 AC 123 ms
94,280 KB
testcase_12 AC 122 ms
95,440 KB
testcase_13 AC 117 ms
93,140 KB
testcase_14 AC 78 ms
82,048 KB
testcase_15 AC 109 ms
91,452 KB
testcase_16 AC 110 ms
91,544 KB
testcase_17 AC 121 ms
94,140 KB
testcase_18 AC 88 ms
84,220 KB
testcase_19 AC 127 ms
95,548 KB
testcase_20 AC 123 ms
95,516 KB
testcase_21 AC 138 ms
98,584 KB
testcase_22 AC 130 ms
96,768 KB
testcase_23 AC 104 ms
107,248 KB
testcase_24 AC 74 ms
80,920 KB
testcase_25 AC 86 ms
92,264 KB
testcase_26 AC 87 ms
94,128 KB
testcase_27 AC 70 ms
80,344 KB
testcase_28 AC 107 ms
110,856 KB
testcase_29 AC 106 ms
110,592 KB
testcase_30 AC 104 ms
92,184 KB
testcase_31 AC 104 ms
89,880 KB
testcase_32 AC 107 ms
90,780 KB
testcase_33 AC 107 ms
90,752 KB
testcase_34 AC 105 ms
90,712 KB
testcase_35 AC 105 ms
91,312 KB
testcase_36 AC 106 ms
92,068 KB
testcase_37 AC 107 ms
91,692 KB
testcase_38 AC 106 ms
90,828 KB
testcase_39 AC 103 ms
90,368 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