問題一覧 > 通常問題

No.2171 OR Assignment

レベル : / AI推定難易度 : 2025 / 実行時間制限 : 1ケース 3.500秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 38
作問者 : 👑 tute7627 / テスター : PCTprobability
お気に入りにしたユーザー ProblemId : 8861 / 自分の提出
問題文最終更新日: 2022-12-20 20:37:51
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2022 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。