結果

問題 No.2071 Shift and OR
ユーザー ytftytft
提出日時 2022-09-22 15:46:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,272 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 106,080 KB
最終ジャッジ日時 2023-08-23 20:34:05
合計ジャッジ時間 8,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
77,632 KB
testcase_01 AC 91 ms
78,204 KB
testcase_02 AC 93 ms
79,136 KB
testcase_03 AC 129 ms
80,160 KB
testcase_04 AC 110 ms
79,668 KB
testcase_05 AC 171 ms
81,792 KB
testcase_06 AC 118 ms
79,700 KB
testcase_07 AC 101 ms
79,324 KB
testcase_08 AC 105 ms
79,576 KB
testcase_09 AC 106 ms
79,576 KB
testcase_10 AC 112 ms
79,616 KB
testcase_11 AC 171 ms
82,276 KB
testcase_12 AC 172 ms
82,268 KB
testcase_13 AC 161 ms
81,668 KB
testcase_14 AC 83 ms
76,820 KB
testcase_15 AC 141 ms
80,724 KB
testcase_16 AC 141 ms
80,584 KB
testcase_17 AC 177 ms
82,200 KB
testcase_18 AC 89 ms
78,072 KB
testcase_19 AC 204 ms
82,652 KB
testcase_20 AC 197 ms
82,912 KB
testcase_21 AC 232 ms
84,884 KB
testcase_22 AC 216 ms
83,368 KB
testcase_23 AC 107 ms
102,488 KB
testcase_24 AC 75 ms
76,116 KB
testcase_25 AC 91 ms
87,732 KB
testcase_26 AC 90 ms
89,668 KB
testcase_27 AC 76 ms
75,672 KB
testcase_28 AC 110 ms
105,936 KB
testcase_29 AC 110 ms
106,080 KB
testcase_30 AC 127 ms
80,260 KB
testcase_31 AC 109 ms
80,120 KB
testcase_32 AC 109 ms
80,380 KB
testcase_33 AC 115 ms
80,060 KB
testcase_34 AC 123 ms
80,420 KB
testcase_35 AC 123 ms
80,088 KB
testcase_36 AC 127 ms
80,200 KB
testcase_37 AC 120 ms
80,204 KB
testcase_38 AC 113 ms
80,412 KB
testcase_39 AC 117 ms
80,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
A=list(map(int,input().split()))
if N>15:
	print(2**16-1)
else:
	pos=[i==0 for i in range(2**16)]
	for i in A:
		temp=i
		newpos=[i==0 for i in range(2**16)]
		for k in range(16):
			temp=(temp//2)+(2**15)*(temp%2)
			for j in range(2**16):
				if pos[j]:
					newpos[j|temp]=1
		pos=newpos
	for i in range(2**16-1,-1,-1):
		if pos[i]:
			print(i)
			break
0