No.2171 OR Assignment
タグ : / 解いたユーザー数 38
作問者 : 👑
tute7627
/ テスター :
PCTprobability
Problem Statement
You are given a sequence of non-negative integers $A = (A_1, A_2,\dots,A_N)$ of length $N$.
You may perform the following operation any number of times, possibly $0$ times.
- Choose an integer $i\ (2 \le i \le N)$ and replace $A_{i}$ with the bitwise OR of $A_i$ and $A_{i-1}$.
Find the number of possible sequences $A$ after the operations, modulo $998244353$.
Input
$N$ $A_1\ A_2\ \dots \ A_N$
- $1 \le N \le 2 \times 10^5$
- $0 \le A_i < 2^{30}$
- All input values are integers.
Output
Print the number of possible sequences $A$ after the operations, modulo $998244353$. Print a newline at the end.
Sample
Sample 1
Input
3 1 3 2
Output
2
For example, performing the operation with $i = 3$ turns the sequence into $(1,3,3)$. No sequence other than $(1,3,2)$ and $(1,3,3)$ can be obtained through the operations.
Sample 2
Input
3 3 2 1
Output
4
Sample 3
Input
10 440 50 1018 120 821 845 412 60 411 1011
Output
884
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。