Problem 2960 --Blank

2960: Blank

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $2$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
There are NN blanks arranged in a row. The blanks are numbered 1,2,…,N1,2,…,N from left to right. 
Tom is filling each blank with one number in {0,1,2,3}{0,1,2,3}. According to his thought, the following MMconditions must all be satisfied. The ithith condition is: 
There are exactly xixi different numbers among blanks ∈[li,ri]∈[li,ri]
In how many ways can the blanks be filled to satisfy all the conditions? Find the answer modulo 998244353998244353.

This problem contains multiple test cases. 
For each test case, the first line contains an integer nn (1≤n≤105,∑n≤2×1061≤n≤105,∑n≤2×106), the number of cars. 
The next three lines each contains n+1n+1 integers, li,si,vili,si,vi (1≤si,vi,li≤1091≤si,vi,li≤109). It's guaranteed that si≥si+1+li+1,∀i∈[0,n−1]
For each test case, output one line containing the answer. Your answer will be accepted if its absolute or relative error does not exceed 10−610−6
Formally, let your answer be aa, and the jury's answer is bb. Your answer is considered correct if |a−b|max(1,|b|)≤10−6|a−b|max(1,|b|)≤10−6
The answer is guaranteed to exist.
2
1 0
4 1
1 3 3
4
96

推荐代码 查看2960 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$260 $ms] 刘成健 450718 2019-08-02 19:56:49
内存最少[$9812 $KB] 淡意的温柔 605329 2020-07-03 14:46:34
第一AC 刘成健 450718 2019-08-02 19:56:49
第一挑战 刘成健 450718 2019-08-02 19:56:49

赛题来源/所属竞赛 2019 Multi-University Training Contest 1 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛