01每日一题tc_srm728_t2

Problem Statement

    

You are given two int[]s L and R, each of length n.

Find the number of strictly increasing sequences of integers A[0] < A[1] < ... < A[n-1] such that L[i] ≤ A[i] ≤ R[i] for every i. Return this number modulo 998244353.

Definition

    
Class:IncreasingSequencesEasy
Method:count
Parameters:int[], int[]
Returns:int
Method signature:int count(int[] L, int[] R)
(be sure your method is public)

Limits

    
Time limit (s):2.000
Memory limit (MB):256

Notes

-The number 998244353 is a prime number.

Constraints

-n will be between 1 and 300, inclusive.
-L will contain exactly n elements.
-R will contain exactly n elements.
-L[i] will be between 1 and 104, inclusive.
-R[i] will be between L[i] and 104, inclusive.

Examples

0) 
    
{1, 3, 1, 4}
{6, 5, 4, 6}
Returns: 4
There are 4 strictly increasing sequences satisfying the conditions: {1, 3, 4, 5}, {1, 3, 4, 6}, {2, 3, 4, 5} and {2, 3, 4, 6}.
1) 
    
{10, 20}
{20, 30}
Returns: 120
 
2) 
    
{20, 10}
{30, 20}
Returns: 0
 
3) 
    
{4, 46, 46, 35, 20, 77, 20}
{41, 65, 84, 90, 49, 86, 88}
Returns: 2470

转载于:https://www.cnblogs.com/xianbei01/p/8418943.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值