社区讨论
题目TeX修复
CF1988E Range Minimum Sum参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @lynokc7l
- 此快照首次捕获于
- 2024/07/16 08:33 2 年前
- 此快照最后确认于
- 2024/07/16 08:54 2 年前
Range Minimum Sum
题目描述
For an array of length , define as the sum of the minimum element over all subsegments. That is,
A permutation is a sequence of integers from to of length containing each number exactly once. You are given a permutation . For each , solve the following problem independently:
Erase from , concatenating the remaining parts, resulting in .
Calculate .
输入格式
Each test contains multiple test cases. The first line contains the number of test cases ( ). Description of the test cases follows.
The first line of each test case contains an integer ( ).
The second line of each test case contains distinct integers ( ).
It is guaranteed that the sum of over all test cases does not exceed .
输出格式
For each test case, print one line containing integers. The -th integer should be the answer when erasing .
样例 #1
样例输入 #1
CPP4
1
1
3
3 1 2
5
4 2 1 5 3
8
8 1 4 6 7 3 5 2
样例输出 #1
CPP0
4 7 5
19 21 27 17 19
79 100 72 68 67 80 73 80
提示
In the second test case, .
- When removing , . .
- When removing , . .
- When removing , . .
回复
共 1 条回复,欢迎继续交流。
正在加载回复...