文件名称:Tight-words
介绍说明--下载内容均来自于网络,请自行研究使用
描述:
提出了一个字母,一个…{ 0 },< = k - k < = 9。我们说一个字的长度n在这个字母是紧如果任何两个邻居位数不同的词不超过1。输入是一个序列的线,每行包含两个整数n、k和1 < = n < = 100。在每一行输入、输出的百分比的长度n多紧单词字母{ 0、1、……,凯西} 5分形位数。
样本输入:
4一
2 5
3 - 5
8 7
样本输出:
100.00000
40.74074
17.38281
0.10130-Descr iption:
Given is an alphabet {0, 1, ... , k}, 0 <= k <= 9 . We say that a word of length n over this alphabet is tight if any two neighbour digits in the word do not differ by more than 1. Input is a sequence of lines, each line contains two integer numbers k and n, 1 <= n <= 100. For each line of input, output the percentage of tight words of length n over the alphabet {0, 1, ... , k} with 5 fractional digits.
Sample Input:
4 1
2 5
3 5
8 7
Sample Output:
100.00000
40.74074
17.38281
0.10130
提出了一个字母,一个…{ 0 },< = k - k < = 9。我们说一个字的长度n在这个字母是紧如果任何两个邻居位数不同的词不超过1。输入是一个序列的线,每行包含两个整数n、k和1 < = n < = 100。在每一行输入、输出的百分比的长度n多紧单词字母{ 0、1、……,凯西} 5分形位数。
样本输入:
4一
2 5
3 - 5
8 7
样本输出:
100.00000
40.74074
17.38281
0.10130-Descr iption:
Given is an alphabet {0, 1, ... , k}, 0 <= k <= 9 . We say that a word of length n over this alphabet is tight if any two neighbour digits in the word do not differ by more than 1. Input is a sequence of lines, each line contains two integer numbers k and n, 1 <= n <= 100. For each line of input, output the percentage of tight words of length n over the alphabet {0, 1, ... , k} with 5 fractional digits.
Sample Input:
4 1
2 5
3 5
8 7
Sample Output:
100.00000
40.74074
17.38281
0.10130
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Tight words.docx