博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
01每日一题tc_srm728_t2
阅读量:5938 次
发布时间:2019-06-19

本文共 1099 字,大约阅读时间需要 3 分钟。

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

你可能感兴趣的文章
Linux下通过配置Crontab实现进程守护
查看>>
ios 打包上传Appstore 时报的错误 90101 90149
查看>>
Oracle推出轻量级Java微服务框架Helidon
查看>>
密码概述
查看>>
nagios+nrpe监控配置错误日志集
查看>>
JavaScript应用开发实践指南迷你书
查看>>
autoconf,automake,libtool
查看>>
jQuery的技巧01
查看>>
基于泛型实现的ibatis通用分页查询
查看>>
gopacket 使用
查看>>
AlertDialog对话框
查看>>
我的友情链接
查看>>
办公室几台电脑怎么连一台打印机的具体步骤
查看>>
linux安全---cacti+ntop监控
查看>>
鸟哥的linux私房菜-shell简单学习-1
查看>>
nagios配置监控的一些思路和工作流程
查看>>
通讯组基本管理任务三
查看>>
赫夫曼编码实现
查看>>
html页面显示div源代码
查看>>
基础复习-算法设计基础 | 复杂度计算
查看>>