当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5230:ZCC loves hacking

题目描述
Now, a Codefires round is coming to end. ZCC has got $C(0\leq C\leq 10^6)$ points by solving all problems. He is amazed that all other contestants in his room have also solved the hardest problem. So he concludes that most contestants are gonna get FST after the contest except the top rated coder Memset137. Before that, ZCC will hack them to make his score higher. There are $N(1\leq N\leq 100000)$ other contestants in ZCC's room. They are sorted by their ratings(So Memset137 is the N-th contestant). When ZCC successfully hacks the i-th contestant, he will get i points. You may assume ZCC can hack every wrong solution in very little time, and Memset137 is the contestant with number N. During that time, other contestants won't bother him.

Since ZCC is a modest winner, he doesn't want his score to be too high. ZCC wonders how many ways are there that he can choose some contestants' solutions except the one submitted by Memset137 and hack them so that his final score is between $L$ and $R$$(C\leq L\leq R< C+N)$.

Obviously the result can be very large, so please output it modulo 998244353.
输入解释
The first line contains an integer $T(T=100)$ which denotes the number of test cases.
For each test case, there will be four integers $N(N\leq 10^5)$, $C$, $L$, $R$ in a single line.

For 95% of the test cases, $N\leq 2000$.
For 97% of the test cases, $N\leq 50000$.
输出解释
For each test case, print a single integer which is the answer.
输入样例
3
3 0 1 2
5 13 14 17
100 0 23 59
输出样例
2
6
90567
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #41

源链接: HDU-5230

最后修改于 2020-10-25T23:20:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 262144/131072K(Java/Others)