所有子数组最长递减子数组长度求和
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
给你一个长度为的排列
计算所有子数组的最长递减子数组的长度之和
结果可能很大,请输出答案对取模之后的答案
子数组是指在一个数组中,选择一些连续的元素组成的新数组。子数组必须包含至少一个元素,并且这些元素在原数组中的顺序保持不变。
最长递减子数组即数组所有子数组中严格递减的数组中最长的数组,例如数组的最长递减子数组为
Format
Input
每个测试点只有一组测试数据:
第一行有一个正整数代表排列的长度
第二行有个正整数,,代表给出的排列
Output
输出一个整数,代表取模之后的答案
Samples
3
2 3 1
8
SDNU_ACM_ICPC_2025秋季结训赛
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 12
- Start at
- 2025-12-28 9:00
- End at
- 2025-12-28 14:00
- Duration
- 5 hour(s)
- Host
- Partic.
- 37