#P3809. 【模板】后缀排序
【模板】后缀排序
Description
Read a string of length consisting of uppercase and lowercase English letters or digits. Sort all its non-empty suffixes in ascending lexicographic order (compared by ASCII values), then output, in that order, the position in the original string of the first character of each suffix. Positions are numbered from to .
Input Format
A single line containing a string of length consisting only of uppercase and lowercase English letters or digits.
Output Format
One line containing integers representing the answer.
ababa
5 3 1 4 2
Hint
.
Translated by ChatGPT 5
京公网安备 11011102002149号