Блог пользователя T_C_D

Автор T_C_D, история, 5 недель назад, По-английски

Suppose i have a dictionary of an alphabet D (|D|>1) and i have an integer n (n between 1 and 1e18). I want to find the nth lexicographical string in this dictionary. How can I solve this problem?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
5 недель назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Suppose there are $$$x$$$ distinct characters, then we can simply transform $$$n$$$ into base $$$x$$$ to get the answer.