题目描述
题目描述
给出一些数字串,判断是否有一个数字串是另一个串的前缀。
输入描述
输入数据为多组数据,每组数据读到9时结束。
输出描述
对于每组数据,如果不存在一个数字串是另一个串的前缀,输出一行Set t is immediately decodable,否则输出一行Set t is not immediately decodable,其中t是这一组数据的组号。
示例1
输入
01
10
0010
0000
9
01
10
010
0000
9
输出
Set 1 is immediately decodable
Set 2 is not immediately decodable
输入样例 #2
011011011
0110110101
9
011011011
0110110111
9
000
001
1
9
0011001100
0110000
010
1110
0000000000
1010101010
1100
11111
9
0011001100
0101
111000100
1010101010
1100
11111
01011101
9
1
11
9
输出样例 #2
Set 1 is immediately decodable
Set 2 is not immediately decodable
Set 3 is immediately decodable
Set 4 is immediately decodable
Set 5 is not immediately decodable
Set 6 is not immediately decodable
输入样例 #3
0
1
9
输出样例 #3
Set 1 is immediately decodable
数据范围
数字串只包含0,1,记每个数字串长度为l,则。每组数据至少有2个数字串,至多有8个数字串。