#P5329. [SNOI2019] 字符串
[SNOI2019] 字符串
Description
Given a string of length consisting of lowercase letters, let its -th character be .
Let be the string obtained after deleting the -th character. Sort in increasing lexicographical order. If two strings are equal, then the one with the smaller index is considered lexicographically smaller.
Input Format
The first line contains an integer .
The second line contains a string of length consisting of lowercase letters.
Output Format
Output one line with integers , separated by spaces, meaning that .
7
aabaaab
3 7 4 5 6 1 2
Hint
Constraints: For all testdata, .
For of the testdata, .
For another of the testdata, and any two adjacent characters are not equal.
For another of the testdata, .
For the remaining of the testdata, there are no special constraints.
Translated by ChatGPT 5
京公网安备 11011102002149号