Universal Cup Judging System

Universal Cup

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

为了纪念已停办的 Code Jam,小 Beth 准备了一场“拥堵代码纪念赛”。Beth 的朋友小 Mho 也来观赛,因此 Beth 想要预测 Mho 的得分。

比赛持续 $T$ 秒,共有 $n$ 道题目。第 $i$ 道题($1 \le i \le n$)的分数为 $a_i$,Beth 预测 Mho 完成该题需要 $t_i$ 秒。

题目分为两种类型:结果可见和结果不可见。结果不可见的题目只有在比赛结束后才知道结果,而结果可见的题目在提交后立即就能知道结果。Beth 尚未确定每道题的类型。

Mho 会先按索引从小到大的顺序完成所有结果可见的题目,然后再按同样的顺序完成所有结果不可见的题目。Mho 完成第 $i$ 道题需要 $t_i$ 秒,且仅当完成第 $i$ 道题及之前所有题目所花费的总时间不超过 $T$ 时,才会对第 $i$ 道题进行提交。

由于 Mho 的提交总是正确的(AC),Beth 想要知道,对于所有 $2^n$ 种确定 $n$ 道题类型的方式,Mho 能获得的总分之和是多少。由于答案可能非常大,你需要将答案对 $998244353$ 取模。

输入格式

第一行包含两个整数 $n, T$($1 \le n \le 200, 1 \le T \le 3 \times 10^5$),分别表示题目数量和比赛时长。

第二行包含 $n$ 个整数 $a_1, a_2, \dots, a_n$($1 \le a_i \le 3 \times 10^5$),表示每道题的分数。

第三行包含 $n$ 个整数 $t_1, t_2, \dots, t_n$($1 \le t_i \le T$),表示 Mho 完成每道题所需的时间。

输出格式

输出一行,包含一个整数,表示在所有 $2^n$ 种确定题目类型的方式下,Mho 能获得的总分之和,对 $998244353$ 取模。

样例

样例输入 1

3 3
2 3 4
1 2 2

样例输出 1

40

Discussions

About Discussions

The discussion section is only for posting: 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.
  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.