Or Max
시간 제한2초메모리 제한512 MB
길이 k가 1부터 n까지일 때 각 길이마다 모든 연속 구간 중 최댓값과 비트 OR의 합이 가장 큰 값을 구한다.
문제
bobo has a sequence . He would like to choose consecutive elements and maximize the value that is defined as their maximum plus their bitwise or.
For all , find the maximal value bobo can achieve.
입력
The first line contains an integer ().
The second line contains integers ().
출력
integers, where the -th integer is maximal for .