#abc263c. C - Monotonically Increasing
C - Monotonically Increasing
Score : points
问题描述
打印所有严格递增的整数序列,其长度为 ,且所有元素均在 到 (包含)之间,按照字典序升序排列。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Print all strictly increasing integer sequences of length where all elements are between and (inclusive), in lexicographically ascending order.
Notes
For two integer sequences of the same length and , is said to be lexicographically earlier than if and only if:
- there is an integer such that for all integers satisfying , and .
An integer sequence is said to be strictly increasing if and only if:
- for all integers .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the sought sequences in lexicographically ascending order, each in its own line (see Sample Outputs).
Sample Input 1
2 3
Sample Output 1
1 2
1 3
2 3
The sought sequences are , which should be printed in lexicographically ascending order.
Sample Input 2
3 5
Sample Output 2
1 2 3
1 2 4
1 2 5
1 3 4
1 3 5
1 4 5
2 3 4
2 3 5
2 4 5
3 4 5
update @ 2024/3/10 11:07:26