题目描述
A string s is LUCKY if and only if the number of different characters in s is a fibonacci number. Given a string consisting of only lower case letters , output all its lucky non-empty substrings in lexicographical order. Same substrings should be printed once.
输入描述:
a string consisting no more than 100 lower case letters.
输出描述:
output the lucky substrings in lexicographical order.one per line. Same substrings should be printed once.
输入例子:
aabcd
输出例子:
a
aa
aab
aabc
ab
abc
b
bc
bcd
c
cd
d
题 干 翻 译 : \color{blue}题干翻译: 题干翻译:
题目的大意就是给你一个字符串
(仅由小写字母组成,并且长度不超过100),让你找出给定字符串的所有LUCKY STRING
子串(子串就是从字符串中截取一段连续的字符序列),所谓的LUCKY STRING
,就是字符串中的的字符种类数是斐波拉契数列中的数字(1,2,3,5,8,13,...)
。
并且输出的LUCKY STRING
子串需要遵守字典升序、不重复!
思 路 分 析 : \color{blue}思路分析: 思路分