SDUT 2022 Spring Individual Contest(for 21) - 9 - Virtual Judge
ou are given nn strings and a new rule of overload the less-than sign, please print the KK-th lexicographically smallest string.
Every string contains only lowercase letters.
A string aa is lexicographically smaller than a string bb if and only if one of the following holds:
- there exists a position ii, a_i < b_iai
- for every ii, a_i=b_iai=bi and the length of aa is less than the length of bb.
Input
The first line gives 2626 characters from aa to zz, each character will appear only once. The earlier a letter appears, the smaller it is. For example, acb cdots xyzacb⋯xyz in the first line means that character 'cc' is less than character 'bb' and character 'cc' is greater than character 'aa'.
The second line contains an integer nn (1 < n < 10^3)(1 Next nn lines, each line contains a string, whose length of the string is less than 10^3103. The next line contains an integer KK (1 leq K leq n)(1≤K≤n), indicating the KK-th smallest string you need to find. Output The KK-th lexicographically smallest string. Sample 1 Sample 2 虽说是一题签到题,但string的用法不熟练,记录一下Inputcopy Outputcopy acbdefghijklmnopqrstuvwxyz
2
abc
acb
1
acb
Inputcopy Outputcopy zabcdefghijklmnopqrstuvwxy
2
a
b
1
a
#include



