QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#12040. 递增序列

الإحصائيات

给定三个长度为 $n$ 的序列 $a[1...n], l[1...n], r[1...n]$,你需要求满足以下所有条件的长度为 $n$ 的序列 $b$ 的个数

  1. 对于 $1\leq i\leq n$,$l[i]\leq b[i]\leq r[i]$
  2. 对于 $1\leq i < n$,$b[i] < b[i+1]$
  3. 对于 $1\leq i\leq n$,$a[i]\&b[i]=a[i]$,这里的 $\&$ 为二进制下的与 (and) 运算符号

由于答案可能很大,你只需要输出答案对 $998244353$ 取模后的值

输入格式

第一行一个正整数 $n$

第二行 $n$ 个整数,表示 $a[1...n]$

第三行 $n$ 个整数,表示 $l[1...n]$

第四行 $n$ 个整数,表示 $r[1...n]$

输出格式

输出答案对 $998244353$ 取模后的值

样例数据

样例 1 输入

3
0 0 0
0 0 0
10 10 10

样例 1 输出

165

子任务

$Task1~(22pts)$:$0\leq a[i],l[i],r[i]\leq 10^5$

$Task2~(26pts)$:对于所有的 $1\leq i\leq n$,满足 $a[i]=0$

$Task3~(52pts)$:无限制

对于所有数据,保证 $0\leq a[i],l[i],r[i] < 2^{60}$,$1\leq n\leq 100$

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.