#P10143. [WC2024] 代码堵塞
[WC2024] 代码堵塞
Problem Description
To commemorate the discontinued Code Jam, Little is preparing a “Code Blockage Memorial Contest”. Little 's friend Little also comes to watch, so Little wants to predict Little 's result.
The contest lasts seconds and has problems. The score of problem is , and Little predicts that Little needs seconds to finish it.
There are two types of problems: visible-result and invisible-result. For an invisible-result problem, you can only know the judging result after the contest ends, while for a visible-result problem, you get the judging result immediately after submission. Little has not yet decided the type of each problem.
Since Little never writes a checker for stress testing, they will first finish all visible-result problems in increasing order of index, and then finish all invisible-result problems in increasing order of index. Little will spend seconds to finish problem . If the total time spent on problem and all problems finished before it is not greater than , then Little will make a submission on problem .
Since every submission by Little is accepted (AC), Little wants to know, over all ways to determine the types of the problems, the sum of the total scores that Little can get. Since the answer can be very large, output it modulo .
Input Format
The first line contains three integers , representing the test point index, the number of problems, and the contest duration. In the sample, indicates that it satisfies the same constraints as test point .
The second line contains integers , representing the score of each problem.
The third line contains integers , representing the time Little needs for each problem.
Output Format
Output one integer, representing, over all ways to determine the problem types, the sum of the total scores Little can obtain, modulo .
1 3 3
2 3 4
1 2 2
40
Hint
Sample 1 Explanation
We use a sequence of length to represent the problem types, where means visible-result and means invisible-result.
- : in these four cases, Little solves problems in increasing order of index, submissions are made on the first two problems, and the score sum is .
- : Little solves in the order , submissions are made on the first two solved problems, and the score sum is .
- : Little solves in the order , submissions are made on the first and third problems, and the score sum is .
- : Little solves in the order , submissions are made on the first and third problems, and the score sum is .
- : Little solves in the order , only the second problem has a submission, and the score sum is .
Therefore, the answer is .
Constraints
For all testdata:
- .
- .
- .
- .
| Test Point Index | Special Property A | Special Property B | ||
|---|---|---|---|---|
| No | ||||
| Yes | Yes | |||
| No | ||||
| No | Yes | |||
| No | ||||
- Special Property A: .
- Special Property B: .
Afterword
“Why are all problems in your contest invisible-result?”
Translated by ChatGPT 5