結果

問題 No.2071 Shift and OR
ユーザー MasKoaTSMasKoaTS
提出日時 2022-09-17 11:40:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 457 ms / 2,000 ms
コード長 1,038 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 122,948 KB
最終ジャッジ日時 2023-08-23 17:38:10
合計ジャッジ時間 13,430 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 193 ms
81,528 KB
testcase_01 AC 225 ms
84,408 KB
testcase_02 AC 210 ms
86,688 KB
testcase_03 AC 277 ms
103,832 KB
testcase_04 AC 232 ms
95,552 KB
testcase_05 AC 345 ms
111,940 KB
testcase_06 AC 250 ms
99,412 KB
testcase_07 AC 220 ms
89,180 KB
testcase_08 AC 247 ms
90,664 KB
testcase_09 AC 245 ms
97,204 KB
testcase_10 AC 255 ms
99,848 KB
testcase_11 AC 367 ms
122,948 KB
testcase_12 AC 328 ms
116,776 KB
testcase_13 AC 305 ms
113,692 KB
testcase_14 AC 196 ms
81,632 KB
testcase_15 AC 302 ms
111,164 KB
testcase_16 AC 313 ms
112,724 KB
testcase_17 AC 371 ms
113,268 KB
testcase_18 AC 203 ms
84,284 KB
testcase_19 AC 424 ms
119,816 KB
testcase_20 AC 382 ms
111,336 KB
testcase_21 AC 457 ms
111,828 KB
testcase_22 AC 427 ms
113,168 KB
testcase_23 AC 238 ms
109,640 KB
testcase_24 AC 206 ms
84,836 KB
testcase_25 AC 217 ms
95,220 KB
testcase_26 AC 222 ms
97,132 KB
testcase_27 AC 203 ms
82,236 KB
testcase_28 AC 241 ms
113,016 KB
testcase_29 AC 233 ms
113,076 KB
testcase_30 AC 309 ms
115,080 KB
testcase_31 AC 243 ms
93,000 KB
testcase_32 AC 251 ms
96,828 KB
testcase_33 AC 254 ms
98,484 KB
testcase_34 AC 268 ms
101,036 KB
testcase_35 AC 266 ms
105,948 KB
testcase_36 AC 290 ms
114,020 KB
testcase_37 AC 258 ms
100,820 KB
testcase_38 AC 255 ms
98,628 KB
testcase_39 AC 242 ms
94,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]
#di = coll.defaultdict(int)


"""
Main Code
"""

n = getN()
a = getList()

if(n >= 16):
	print(65535)
	exit(0)

def shift(x):
	return (x >> 1) | ((x & 1) << 15)

st = set([0])
for k in a:
	bst = set([k])
	b = k
	for _ in [0]*16:
		b = shift(b)
		bst.add(b)
	nst = set([])
	for x in st:
		for y in bst:
			nst.add(x | y)
	st = set(nst)

print(max(st))
0